[Form] [Validator] When using group sequences on a form, sometimes constraints are ignored even though they should fail. #38300
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Symfony version(s) affected: >= 4.4.10
Description
When using group sequences on a form, sometimes constraints are ignored even though they should fail. This appears to happen where there is a field with multiple constraints added with a group sequence and also an additional field that does not have any constraints whatsoever. It appears to matter whether the additional field is added before or after the field with the constraints that have a sequence.
My initial case was a much more complicated form, but this seems to be the root of the problem.
So far, i only have a failing test case. It is a copy of the test above with only one change: an additional field above the field that was already there.
Because i had a failing test case, i decided to create a PR, but if you'd rather i make an issue, i can close this and do that instead.