{"action":"opened","issue":{"url":"https://api.github.com/repos/symfony/symfony/issues/16022","labels_url":"https://api.github.com/repos/symfony/symfony/issues/16022/labels{/name}","comments_url":"https://api.github.com/repos/symfony/symfony/issues/16022/comments","events_url":"https://api.github.com/repos/symfony/symfony/issues/16022/events","html_url":"https://github.com/symfony/symfony/issues/16022","id":109082271,"number":16022,"title":"UniqueEntity constraint should produce better messages when enforced on multiple fields","user":{"login":"thedamnedrhino","id":8396998,"avatar_url":"https://avatars.githubusercontent.com/u/8396998?v=3","gravatar_id":"","url":"https://api.github.com/users/thedamnedrhino","html_url":"https://github.com/thedamnedrhino","followers_url":"https://api.github.com/users/thedamnedrhino/followers","following_url":"https://api.github.com/users/thedamnedrhino/following{/other_user}","gists_url":"https://api.github.com/users/thedamnedrhino/gists{/gist_id}","starred_url":"https://api.github.com/users/thedamnedrhino/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thedamnedrhino/subscriptions","organizations_url":"https://api.github.com/users/thedamnedrhino/orgs","repos_url":"https://api.github.com/users/thedamnedrhino/repos","events_url":"https://api.github.com/users/thedamnedrhino/events{/privacy}","received_events_url":"https://api.github.com/users/thedamnedrhino/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-09-30T13:04:52Z","updated_at":"2015-09-30T13:04:52Z","closed_at":null,"body":"The `UniqueEntity` constraint ensures the uniqueness of an entity based on the value of some given fields. Now for a single field of the Entity the violation is built properly and the path can be retrieved via `ConstraintViolationInterface::getPropertyPath`. But when using multiple fields, the aforementioned method will return only the first field, and `ConstraintViolationInterface::getInvalidValue` will return will only the value for the first field.    \r\nI have automated displaying error messages to the user from `ConstraintViolation` objects by using the `getMessage` , `getMessageParameters` and `getInvalidValue` of `ConstraintViolationInterface` implementing objects returned from the validator. I think the `fields` (or the `implode`d version) option should be added as a message parameter on the violation, and the value of all given fields (or maybe an associative array) should be returned when calling `ConstraintViolationInterface::getInvalidValue` on the violation built by `UniqueEntityValidator`."}}