-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
Explain the limitations of the custom messages in UniqueEntity #6932
Conversation
@@ -132,7 +132,11 @@ message | |||
|
|||
**type**: ``string`` **default**: ``This value is already used.`` | |||
|
|||
The message that's displayed when this constraint fails. | |||
The message that's displayed when this constraint fails. When using multiple | |||
fields, the ``{{ vallue }}`` parameter only contains the value of the first |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
actually {{ value }}
represents the entity, but only the first invalid field will trigger a violation to its path
Wonderful 👍 Thanks! Status: reviewed |
👍 |
This was first included in Symfony 3.1, wasn't it? I would also add a .. versionadded:: 3.1
The ability to include the invalid value into the message was introduced
in Symfony 3.1. Status: Needs work |
@xabbuh I've finally added the missing |
👍 Status: Reviewed |
Thanks for documenting this new feature Javier! I've merged this into 3.1, because this feature was introduced in 3.1 according to Christian. |
…eEntity (javiereguiluz) This PR was submitted for the 2.8 branch but it was merged into the 3.1 branch instead (closes #6932). Discussion ---------- Explain the limitations of the custom messages in UniqueEntity This fixes #6929. Thanks goes to @HeahDude, who made all the "detective work" to find this limitation. Commits ------- 4c10ea8 Explain the limitations of the custom messages in UniqueEntity
This fixes #6929. Thanks goes to @HeahDude, who made all the "detective work" to find this limitation.