-
-
Notifications
You must be signed in to change notification settings - Fork 62
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
PHP Warning: Invalid argument supplied for foreach() in vendor/masbug/flysystem-google-drive-ext/src/GoogleDriveAdapter.php on line 1104 #91
Comments
The information is not complete, feel free to make a PR to fix that |
apologies, i'm a bit of a newbie at this. filesystems.php is configured thusly:
running the command Storage::disk('google')->getAdapter()->hasDir('[ valid directory name]') in the artisan tinker console those php warnings are generated. i was able to trace it back to those 2 functions. also to note, this does not occur when using a standard/non-team google drive folder If by PR you mean problem report, i thought that is what i was doing here. If there is some other way i should report this, please let me know and i would be happy to do so |
PR means PULL REQUEST Also do you have the latest version of this package? there is no foreach on line 1104
Laravel 7 has no support at this time, it did reaches his end of life since 2021 |
i followed the instructions for Flysystem V1 or Laravel <= 8.x.x use 1.x.x version of the package okay, i'll try when i upgrade to Laravel 9 |
Same issue after upgrading to Laravel Framework 9.46.0 and masbug/flysystem-google-drive-ext v2.2.2
WARNING foreach() argument must be of type array|object, null given in vendor/masbug/flysystem-google-drive-ext/src/GoogleDriveAdapter.php on line 1166. = [ |
Avoid And try Storage::disk('google')->getAdapter()->directoryExists('valid directory'); |
still get the same warnings
|
Maybe it is something on your implementation, it is working for me |
are you using a teamDriveId? in that link it is commented out |
Yes |
using that demo project when i try the list-files route i get and exception the list-team-drives route works okay and that is the team drive id i have defined in .env |
i did |
Hi, if you know the line of the bug, make a fix and send a pull request, maybe the authors won't be able to replicate your problem |
sadly i don't. [2023-01-13 18:02:09] laravel.EMERGENCY: Unable to create configured logger. Using emergency logger. {"exception":"[object] (InvalidArgumentException(code: 0): Log [] is not defined. at /var/www/html/laravel-google-drive-demo/vendor/laravel/framework/src/Illuminate/Log/LogManager.php:200) |
So, make a debug, find the problem, fix it, and then make the pull request |
apologies again, i'm a bit of a newbie at this, once i figure out how to submit a PR i will gladly do so. I have found my issue, the google drive api version 3 deprecated includeTeamDriveItems and replaced it with supportsAllDrives. the valid corpora bodies are user, domain, drive, and allDrives. i was able to resolve my issue by updating these functions
as for my original issue, $object->getPermissions() is still returning null however i was able to resolve the issue using the logic submitted in PR #92 in the normalizeObject function. |
That functions are already updated, You are probably not using the latest version. flysystem-google-drive-ext/src/GoogleDriveAdapter.php Lines 2181 to 2191 in 3947d39
flysystem-google-drive-ext/src/GoogleDriveAdapter.php Lines 2204 to 2219 in 3947d39
|
Merged. |
when teamdrive is enabled i start getting these warnings when checking directory existence via Storage::disk('google')->getAdapter()->hasDir('directory')
also get the same warnings from flysystem-google-drive-ext/src/GoogleDriveAdapter.php on line 981
looks like $object->getPermissions() in function normaliseObject and $file->getPermissions() in function getRawVisibility are both returning null
The text was updated successfully, but these errors were encountered: