Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Form] Fix the usage of the Valid constraints in array-based forms #45702

Merged
merged 1 commit into from
Mar 11, 2022

Conversation

stof
Copy link
Member

@stof stof commented Mar 10, 2022

Q A
Branch? 4.4
Bug fix? yes
New feature? no
Deprecations? no
Tickets n/a
License MIT
Doc PR n/a

This is a bug introduced in #39333. When wanting to exclude scalar forms, it also excluded array forms.
The code now uses the same \is_object($data) || \is_array($data) condition for Valid constraint than the condition it uses as part of the $validateDataGraph condition.

The new tests reflects my own use case: an unmapped collection field, were we want to run the validation on that subtree (which is not traversed for other reasons due to being unmapped, and so we need Valid). This was working fine in older versions of Symfony, but the validation was silently skipped in 4.4.18+.

@carsonbot carsonbot added this to the 4.4 milestone Mar 10, 2022
@carsonbot carsonbot changed the title Fix the usage of the Valid constraints in array-based forms [Form] Fix the usage of the Valid constraints in array-based forms Mar 10, 2022
@stof stof force-pushed the fix_form_valid_constraints branch from de1ebfc to 542c2fb Compare March 10, 2022 13:05
@stof stof merged commit a2fc328 into symfony:4.4 Mar 11, 2022
@stof stof deleted the fix_form_valid_constraints branch March 11, 2022 09:19
This was referenced Apr 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants