Closed nicoip closed 9 years ago
Hi @nicoip
Could you please show us the generated form from the Admingen?
Don't you have any specfic configuration in your YAML for the edit action?
I'm also wondering if it is not because of the Assert\File
validation constraint. Could you please try to remove it (just to make a test) and see if your issue persist?
Thank you,
Hi, It works by removing the Assert\File validation constraint. There is no specfic configuration in your YAML for the edit action Thank you,
Hi @nicoip
"It works by removing the Assert\File validation constraint."
So I guess this is an issue out of the single_upload component.
You need to find a way to say "this field could be empty, but if it's not, it need to be a file with a maximum size of 3M" (to be sure about that, could you replace the single_upload
component by a simple file
form type and test?)
If the behavior is the same with the file
form type, I think you have several ways to handle constraint:
innject_onn_load
behavior (so your file will be always present in your field and validation should always be successful). Take care this could increase your application load depending on where your files are uploadedForget the reference, just an error from my side
@nicoip : any news on that issue?
Isn't that the expected behaviour of @Assert\File
? I believe this is not a bug, but symfony's implementation of that assertion.
@loostro and @sescandell , I also think that it is the behavior of symfony.
Well, as @sescandell suggested, you can play with validation_groups
to turn on/off diffrent assertions. Closeing as this is not a bug on our side.
Hello,
I use the singl_upload in my form, but when I want to send in my edit form without adding a file, I get the message : "The file could not be found."
I wish the single upload is optional and no requiered
Have you any idea?
Thank you