PHP warning: Undefined array key "0770"

Created on 15 March 2023, over 1 year ago
Updated 9 August 2023, 11 months ago

Problem/Motivation

I'm getting this PHP warning on articles containing media entities.

Warning: Undefined array key "0770" in Twistor\Flysystem\Plugin\Stat->mergeMeta() (line 157 of vendor/twistor/flysystem-stream-wrapper/src/Flysystem/Plugin/Stat.php).

In this flysystem plugin, it's expecting a "visibility" of a code that corresponds to either "public" or "private". Instead of one of those, the files have a visibility of 0770, which apparently in some file systems is used as a "custom" file permission which then can have further handling done. So I added a line that says if it's 0770 then we're going to say it's "public" (because these files should be public).

This doesn't seem like an ideal solution, but it does prevent the warning. If anyone has a better solution or thoughts on what causes it, I'd love to hear them.

Steps to reproduce

I'm actually not sure if this is particular to our environment. This occurs on Pantheon environments using flysystem_s3.

Upgrade to PHP 8.1. Create a node that has a media item attached that uses flysystem_s3.

πŸ› Bug report
Status

Postponed

Version

3.0

Component

Code

Created by

πŸ‡¨πŸ‡¦Canada Laura Johnson Toronto

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.69.0 2024