-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
UniqueEntityValidator with multiple constraints fails if the first constraint is null #21554
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
Comments
@gigib82 Sorry for breaking this. Can you confirm that #21562 fixes the issue for you? |
Tested #21562: there is now a behavioural difference with respect to the previous released version. |
@gigib82 Did you enable or disable the |
No, never explicitly set that option. |
@gigib82 I updated #21562. Would you mind checking it again? |
The same test suite that spotted the errors is now ok, so I would say #21562 fixes the error |
Thanks for the confirmation. |
…lue (xabbuh) This PR was merged into the 2.7 branch. Discussion ---------- [DoctrineBridge] make sure that null can be the invalid value | Q | A | ------------- | --- | Branch? | 2.7 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #21554 | License | MIT | Doc PR | Commits ------- c3702c2 make sure that null can be the invalid value
Scenario: I'm validating an entity like this
If
accountId
happens to be null, UniqueEntityValidator will now exclude it from the constraint list (since commit 1e3421d ), failing later on because$criteria[$fields[0]]
is an invalid array access:fields[0]
is the string "accountId", which is not in$criteria
.Reverting lines 88-94 to the version before the commit linked above fixes the issue.
The text was updated successfully, but these errors were encountered: