You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I included an image field in a repeatable element.
I add a repeatable entry and save the page once without adding an image to its subfield, all is fine.
I then going back in to edit and select an image for that same subfield
The upload handler tries to delete the old (nonexistent) image, which throws an error (see below)
What I expected to happen
I expected that the entry would just be saved with the new image, and the old one only getting
What happened
This throws the following error:
League\Flysystem\Filesystem::delete(): Argument #1 ($location) must be of type string, null given, called in /<redacted>/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemAdapter.php on line 513
It has to do with this function in Backpack \ CRUD \ app \ Library \ Uploaders \ SingleBase64Image:
As you can see this does not check anywhere whether an image actually exists in the spot where it tries to delete it.
What I've already tried to fix it
Updated all backpack packages, made a completely new model with repeatable field that only has an image. Repeated the steps under "What I did". The error remains.
Is it a bug in the latest version of Backpack?
After I run composer update backpack/crud the bug... is it still there?
Yes
Backpack, Laravel, PHP, DB version
When I run php artisan backpack:version the output is:
Thanks for pointing out the issue. We are already working on major refactoring of the Backpack Uploader to cover this and other uploader-related problems. It's a BIG PR, which may take some time. Sorry for the inconvenience.
You can subscribe to our newsletter for the Backpack Progress report and other updates.
That sounds like a great idea. I've fixed it by overwriting the uploader for now, so no rush in that regard for me. I fully trust you'll make something much better than my hacky solution here and will happily update my project whenever you're done with that.
Bug report
What I did
What I expected to happen
I expected that the entry would just be saved with the new image, and the old one only getting
What happened
This throws the following error:
It has to do with this function in
Backpack \ CRUD \ app \ Library \ Uploaders \ SingleBase64Image
:As you can see this does not check anywhere whether an image actually exists in the spot where it tries to delete it.
What I've already tried to fix it
Updated all backpack packages, made a completely new model with repeatable field that only has an image. Repeated the steps under "What I did". The error remains.
Is it a bug in the latest version of Backpack?
After I run
composer update backpack/crud
the bug... is it still there?Yes
Backpack, Laravel, PHP, DB version
When I run
php artisan backpack:version
the output is:The text was updated successfully, but these errors were encountered: