Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deleting returns "PHP Warning: Trying to access array offset on value of type bool in src/Storage/AbstractCache.php on line 130" #52

Closed
osynlignz opened this issue Aug 5, 2022 · 5 comments

Comments

@osynlignz
Copy link

When deleting an image, deletion from bucket is successful and entry is deleted from SS, but request returns a 500 Error in the console and we receive the following PHP Warning in the logs:

PHP Warning: Trying to access array offset on value of type bool in .../vendor/league/flysystem-cached-adapter/src/Storage/AbstractCache.php on line 130

SilverStripe 4.10.2
silverstripe/s3 1.1.1
league/flysystem 1.1.9
PHP 8.0.8

@japo32
Copy link

japo32 commented Oct 11, 2022

Happening on my setup as well.

SS 4.11.2
silverstripe/s3 1.1.1
league/flysystem 1.1.10
PHP 8.0.8

@japo32
Copy link

japo32 commented Oct 13, 2022

@osynlignz I've solved it!

TLDR: when we upgraded Silverstripe psr/cache was upgraded which forced league/flysystem-cached-adapter to get downgraded which caused the break.

here's a summary:

psr/cache had been upgraded to 2.0.0 which downgraded league/flysystem-cached-adapter to 1.0.2.
The latest league/flysystem-cached-adapter 1.0.9 requires psr/cache ^1.0.
This was the source of the break.

So I had to manually dowgrade psr/cache to 1.0.1 so flysystem-cached-adapter can upgrade.

Also, note that flysystem-cached-adapter has version 1.1.0 but the latest silverstripe/s3 1.2.1 requires ^1.0.

Version changes in my setup:

psr/cache 2.0.0 => 1.0.1
league/flysystem-cached-adapter 1.0.2 => 1.0.9
silverstripe/s3 1.1.1 => 1.2.1

@Khalsa-jio
Copy link

Khalsa-jio commented Apr 9, 2023

Thanks @japo32 , It helped me to fix the issue....
I was getting this issue while publishing the image without saving it as draft.

composer require psr/cache:^1.0.1
composer require league/flysystem-cached-adapter:^1.0.9
composer require silverstripe/s3:^1.0

@abdou-ghonim
Copy link

It's happening on my setup as well.

SS 5
SilverStripe/s3 1.4
PHP 8.1

@obj63mc
Copy link
Collaborator

obj63mc commented Sep 20, 2023

@wilr wilr closed this as completed Jun 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants