-
Notifications
You must be signed in to change notification settings - Fork 20
After Enable Symfony Automatic validation Timestampable Entity always fail form validation #4
Comments
Hi @stayeronglass, this error could be fix in the 4.4, with an annotation The fact is, when the data are sent with the form, the validator try to validate the Entity, but with auto validation, because Timestampable Trait (if youy use it) required to be not null, but because you're not already in the pre persist doctrine event. The updatedAt and createdAt property are null. You actually can authorize this properties to be null to avoid the auto validation on this properties. Then in 4.4, you can add the special Assertion. But, I'm not sure the Traits are not in this Bundle but in the Gedmo extension. |
I try update project from Fields |
Do you have any constraints on these fields? Looks like the problem is in
|
@BoShurik Thank you for the answer, and a tip where to look for the problem!!! As I said earlier,
In my case, deleting the annotation I don't know it works right or not, and how disabling should work right... I think it's a little crooked:
|
As I said you need to replace |
Yes, everything works! That's great! Thanks!!! |
https://symfony.com/blog/new-in-symfony-4-3-automatic-validation
if ($form->isSubmitted() && $form->isValid()) - always fail after enable Automatic validation
The text was updated successfully, but these errors were encountered: