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

[Validator] Fixed default group for nested composite constraints #36365

Merged
merged 1 commit into from Apr 12, 2020

Conversation

HeahDude
Copy link
Contributor

@HeahDude HeahDude commented Apr 6, 2020

Q A
Branch? 3.4
Bug fix? yes
New feature? no
Deprecations? no
Tickets Fix #33986
License MIT
Doc PR ~

Take a breath: when composite constraints are nested in a parent composite constraint without having non composite nested constraints (i.e empty), then the default group is not added, making the validator failing to validate in any group (including default), because there is no group at all, which should never happen.

@HeahDude HeahDude force-pushed the validator/fix-nested-composite branch from 4a79a21 to 117ee34 Compare April 8, 2020 10:54
@fabpot
Copy link
Member

fabpot commented Apr 12, 2020

Thank you @HeahDude.

@fabpot fabpot merged commit 6a27337 into symfony:3.4 Apr 12, 2020
@HeahDude HeahDude deleted the validator/fix-nested-composite branch April 12, 2020 12:42
This was referenced Apr 28, 2020
nicolas-grekas added a commit that referenced this pull request May 30, 2020
…tional) constraints (xabbuh)

This PR was merged into the 3.4 branch.

Discussion
----------

[Validator] never directly validate Existence (Required/Optional) constraints

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #36637 #36723
| License       | MIT
| Doc PR        |

Using `Optional` or `Required` like "regular" constraints does not make any sense, but doing so didn't break before #36365. I suggest to ignore them for now and deprecate using them outside the `Collection` constraint in 5.2.

Commits
-------

d333aae never directly validate Existence (Required/Optional) constraints
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.

ConstraintValidator allows extra fields if all children are optional
6 participants