-
Notifications
You must be signed in to change notification settings - Fork 908
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
[Bug] Image Validation when more than one in the same CRUD [pro] #5706
Comments
Note: same issue if I use Validation rule in the Http\ModelRequest class: The following example is for a similar use case, not the one reported in the issue. But actually it behaves the same.
|
Hey @pxpm I think the problem is our Image field is unnecessarily sending the stored path("string") when no file is selected, causing the validation error. where if filled it - it expects base64.
|
Hi! I wonder if this issue could be solved soon or a workaround could be provided. |
Hey @manfield Sorry, it took so long to get back to this. At first, I thought it was a bug, but when I inspected the
I tried your case, and it worked for me with the following validation rules:
Screen.Recording.2025-02-04.at.2.13.10.PM.movJust try it and let me know your thoughts. Sorry again, It took so long. |
Hi @karandatwani92 , It works for me. Thanks a lot again |
Bug report
What I did
Let's have a CRUD controller with these fields:
What I expected to happen
Let's add the two images at the same time on a new object:
Screen.Recording.2024-10-24.at.22.40.24.mp4.mp4
All good!
Let's modify the second now:
Screen.Recording.2024-10-24.at.22.43.10.mp4.mp4
As you can see the first of the two fields raises a validation error, though:
What happened
Image validation has some bugs when using more than one image field on the same CRUD controller
Note: the same error is reported even if the image is in a repeatable/relationship field's subfield
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: