You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
After updating the form component to version 4.2.3, the method ValidatorInterface::validate($formType) stopped returning any violations when it contains an invalid value object.
The previous behaviour was a bug that was fixed in #30265 (see the many referenced bug reports there for more details). I don't think there is anything we can do about it.
Maybe you can describe your use case and we can think about alternative solutions to your problem.
This came up because I keep my validation constraints inside my form types and came up with a case where I need to validate my data without having an HTTP request at hand.
As long as that's expected behavior, I'll try calling $form->submit() for my data and keep working from there
For that use case I would probably rather move the constraints to your underlying model because that's the data you seem to want to validate. Validating a form only makes sense if there are submitted data (and then I would only add constraints to form fields that are not mapped to the model).
Symfony version(s) affected: 4.2.*
Description
After updating the form component to version 4.2.3, the method
ValidatorInterface::validate($formType)
stopped returning any violations when it contains an invalid value object.How to reproduce
This is the common code between the two versions
https://github.com/Loupax/broken_validation/blob/master/src/Controller/DefaultController.php
Please note how we don't actually submit the form. This is done on purpose.
You can switch between the following branches for a working an broken example
https://github.com/Loupax/broken_validation/blob/working_example/composer.json#L14
https://github.com/Loupax/broken_validation/blob/broken_example/composer.json#L14
The text was updated successfully, but these errors were encountered: