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
bug symfony#57213 [Validator] [UniqueValidator] Use correct variable as parameter in (custom) error message (seho-nl, Sebastien Hoek)
This PR was squashed before being merged into the 5.4 branch.
Discussion
----------
[Validator] [UniqueValidator] Use correct variable as parameter in (custom) error message
| Q | A
| ------------- | ---
| Branch? | 5.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Issues |
| License | MIT
Unique constraint should use the `$element` (the element violating uniqueness) and not `$values` (the collection) to build the error message.
When adding a custom message to the Constraint, for example
`message: 'Duplicate element found with value {{ value }}'`
It outputs:
`Duplicate element found with value "array"`
And the expected output should be:
`Duplicate element found with value "main"` (where main is an example value in the collection).
Commits
-------
8ef75c2 [Validator] [UniqueValidator] Use correct variable as parameter in (custom) error message
0 commit comments