Added an image field in a repeatable field, and used withFiles for storage. The first save, the image is uploaded correctly. When updating the entry again and not changing the image, the image is deleted.
Steps to reproduce:
Create new entry
Add repeatable item and include image
Save entry
Edit entry
Save entry without changing anything
Edit entry -> image is now deleted
What I expected to happen
Image should not be deleted
What happened
Image was deleted anyway. It seems like the repeatable field thinks I replaced it and thus wants to delete the old image.
What I've already tried to fix it
Tried this in a completely new entry which only has a repeatable field which only has one image field.
Disabled deleteWhenEntryIsDeleted but as expected this has no effect on this behavior
I have now disabled the Storage::disk($this->getDisk())->delete($image); line in uploadRepeatableFiles, in vendor/Backpack/CRUD/app/Library/Uploaders/SingleBase64Image.php on line 57, but this is of course not the appropriate solution.
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:
Bug report
What I did
Added an image field in a repeatable field, and used withFiles for storage. The first save, the image is uploaded correctly. When updating the entry again and not changing the image, the image is deleted.
Steps to reproduce:
What I expected to happen
Image should not be deleted
What happened
Image was deleted anyway. It seems like the repeatable field thinks I replaced it and thus wants to delete the old image.
What I've already tried to fix it
deleteWhenEntryIsDeleted
but as expected this has no effect on this behaviorI have now disabled the
Storage::disk($this->getDisk())->delete($image);
line inuploadRepeatableFiles
, invendor/Backpack/CRUD/app/Library/Uploaders/SingleBase64Image.php
on line 57, but this is of course not the appropriate solution.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: