-
-
Notifications
You must be signed in to change notification settings - Fork 530
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
'Root' path container issue after upgrading to 3.3 / Laravel 9 #5535
Comments
I'm guessing this will be related to the recent Flysystem changes in 3.3. |
We also ran into this issue with DigitalOcean Spaces after upgrading to Statamic 3.3.2 and Laravel 9.5.1. Somehow, Flysystem's S3 adapter behaves differently in Since the path is empty, We temporarily fixed the control panel by adding private function getFiles()
{
return $this->container()->listContents()->reject(function ($file) {
return $file['type'] !== 'file'
|| !isset($file['dirname'])
|| $file['dirname'] === '.meta'
|| Str::contains($file['path'], '/.meta/')
|| in_array($file['basename'], ['.gitignore', '.gitkeep', '.DS_Store']);
});
} |
As #5622 mentioned, the issue appears to only occur when a 'root' directory is specified in the filesystem config. Assuming this is related to the updated version of flysystem that Laravel 9 uses. |
We temporarily override the
private function getFiles()
{
return $this->container()->listContents()->reject(function ($file) {
return $file['type'] !== 'file'
|| !isset($file['dirname'])
|| $file['dirname'] === '.meta'
|| Str::contains($file['path'], '/.meta/')
|| in_array($file['basename'], ['.gitignore', '.gitkeep', '.DS_Store']);
});
}
"autoload": {
"psr-4": {
"App\\": "app/",
"Statamic\\": "app/Statamic/",
"Database\\Factories\\": "database/factories/",
"Database\\Seeders\\": "database/seeders/"
},
"exclude-from-classmap": [
"vendor/statamic/cms/src/Stache/Stores/ContainerAssetsStore.php"
]
},
|
@staudenmeir Thanks for the work around! |
Hi all, A new version of Flysystem has been releases which addresses this (or a very similar issue), has anybody tried 3.0.13 yet to see if this works without the work around? See thephpleague/flysystem#1437 |
Thanks @frankdejonge, the latest release fixes the issue for me. |
@frankdejonge fixes the issue for me as well. Thank you. |
Bug description
I'm getting an 'Undefined array key "dirname"' error on any URI's that contain references to Digital Ocean Assets.
I've used Spatie/Ray to troubleshoot the indicated problem method in the stacktrace
ContainerAssetsStore.php@getFiles()
.It looks like a non-existent file is entering the method without a 'dirname' key or any other data. I manually checked the Digital Ocean Space - there are only three assets in there, and their corresponding .yaml files. They all appear in the Ray dumps. Not sure where this particular file is coming from, or why its missing the dirname key.
My temporary fix is just to comment out the check for the dirname key in
ContainerAssetsStore.php@getFiles()
and everything works fine.How to reproduce
I can't exactly share my DO credentials for an issue reproduction.
Logs
Versions
Installation
Fresh statamic/statamic site via CLI
Additional details
No response
The text was updated successfully, but these errors were encountered: