Symfony 2.8 : why validator (constraint & validator) are not executed when I edit my entity

16 Views Asked by At

I'm working on a legacy code from Symfony 2.8. There is a custom constrain on a date property of an entity. When I create a new entry of this entity via a form, if I don't respect the constraint the validator raises a violation (as expected). But if I go edit an already existing entry of this entity, and I willingly set its property so it doesn't match the contraint, there is no violation raised when I submit the form and the entry is updated with an incorrect property value.

Is it a correct behavior of a custom constraint ? Is there a way to execute the constraintValidator on an editAction ?

I made a complete new constraint / validator couple where the validator always builds a violation. I was expecting the violation to be raised on the editAction. It was not.

0

There are 0 best solutions below