{"action":"created","issue":{"url":"https://api.github.com/repos/yiisoft/yii2/issues/11322","repository_url":"https://api.github.com/repos/yiisoft/yii2","labels_url":"https://api.github.com/repos/yiisoft/yii2/issues/11322/labels{/name}","comments_url":"https://api.github.com/repos/yiisoft/yii2/issues/11322/comments","events_url":"https://api.github.com/repos/yiisoft/yii2/issues/11322/events","html_url":"https://github.com/yiisoft/yii2/issues/11322","id":147322300,"number":11322,"title":"UniqueValidator misleading error message for multiple targetAttribute's","user":{"login":"PowerGamer1","id":8275897,"avatar_url":"https://avatars.githubusercontent.com/u/8275897?v=3","gravatar_id":"","url":"https://api.github.com/users/PowerGamer1","html_url":"https://github.com/PowerGamer1","followers_url":"https://api.github.com/users/PowerGamer1/followers","following_url":"https://api.github.com/users/PowerGamer1/following{/other_user}","gists_url":"https://api.github.com/users/PowerGamer1/gists{/gist_id}","starred_url":"https://api.github.com/users/PowerGamer1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PowerGamer1/subscriptions","organizations_url":"https://api.github.com/users/PowerGamer1/orgs","repos_url":"https://api.github.com/users/PowerGamer1/repos","events_url":"https://api.github.com/users/PowerGamer1/events{/privacy}","received_events_url":"https://api.github.com/users/PowerGamer1/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/yiisoft/yii2/labels/status:ready%20for%20adoption","name":"status:ready for adoption","color":"02e10c"},{"url":"https://api.github.com/repos/yiisoft/yii2/labels/type:enhancement","name":"type:enhancement","color":"d7e102"}],"state":"closed","locked":false,"assignee":{"login":"cebe","id":189796,"avatar_url":"https://avatars.githubusercontent.com/u/189796?v=3","gravatar_id":"","url":"https://api.github.com/users/cebe","html_url":"https://github.com/cebe","followers_url":"https://api.github.com/users/cebe/followers","following_url":"https://api.github.com/users/cebe/following{/other_user}","gists_url":"https://api.github.com/users/cebe/gists{/gist_id}","starred_url":"https://api.github.com/users/cebe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cebe/subscriptions","organizations_url":"https://api.github.com/users/cebe/orgs","repos_url":"https://api.github.com/users/cebe/repos","events_url":"https://api.github.com/users/cebe/events{/privacy}","received_events_url":"https://api.github.com/users/cebe/received_events","type":"User","site_admin":false},"assignees":[{"login":"cebe","id":189796,"avatar_url":"https://avatars.githubusercontent.com/u/189796?v=3","gravatar_id":"","url":"https://api.github.com/users/cebe","html_url":"https://github.com/cebe","followers_url":"https://api.github.com/users/cebe/followers","following_url":"https://api.github.com/users/cebe/following{/other_user}","gists_url":"https://api.github.com/users/cebe/gists{/gist_id}","starred_url":"https://api.github.com/users/cebe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cebe/subscriptions","organizations_url":"https://api.github.com/users/cebe/orgs","repos_url":"https://api.github.com/users/cebe/repos","events_url":"https://api.github.com/users/cebe/events{/privacy}","received_events_url":"https://api.github.com/users/cebe/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/yiisoft/yii2/milestones/17","html_url":"https://github.com/yiisoft/yii2/milestones/2.0.9","labels_url":"https://api.github.com/repos/yiisoft/yii2/milestones/17/labels","id":1580065,"number":17,"title":"2.0.9","description":"","creator":{"login":"cebe","id":189796,"avatar_url":"https://avatars.githubusercontent.com/u/189796?v=3","gravatar_id":"","url":"https://api.github.com/users/cebe","html_url":"https://github.com/cebe","followers_url":"https://api.github.com/users/cebe/followers","following_url":"https://api.github.com/users/cebe/following{/other_user}","gists_url":"https://api.github.com/users/cebe/gists{/gist_id}","starred_url":"https://api.github.com/users/cebe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cebe/subscriptions","organizations_url":"https://api.github.com/users/cebe/orgs","repos_url":"https://api.github.com/users/cebe/repos","events_url":"https://api.github.com/users/cebe/events{/privacy}","received_events_url":"https://api.github.com/users/cebe/received_events","type":"User","site_admin":false},"open_issues":0,"closed_issues":154,"state":"closed","created_at":"2016-02-12T16:35:34Z","updated_at":"2016-07-11T13:40:39Z","due_on":"2016-07-09T22:00:00Z","closed_at":"2016-07-11T13:40:39Z"},"comments":9,"created_at":"2016-04-11T05:48:07Z","updated_at":"2016-07-26T12:32:41Z","closed_at":"2016-07-06T12:34:33Z","body":"When `UniqueValidator` is setup like this:\r\n```PHP\r\n // a1 and a2 need to be unique together, and they both will receive error message\r\n [['a1', 'a2'], 'unique', 'targetAttribute' => ['a1', 'a2']]\r\n```\r\nand the pair of fields fails unique check the validator produces two separate error messages that are completely wrong and misleading:\r\n```\r\na1 \"123\" has already been taken.\r\na2 \"456\" has already been taken.\r\n```\r\n\r\nThe actual error messages should have been along the lines:\r\n```\r\nThe combination (\"123\", \"456\") of (a1, a2) has already been taken.\r\nThe combination (\"123\", \"456\") of (a1, a2) has already been taken.\r\n```\r\n\r\n| Yii version      |  2.0.8-dev\r\n| PHP version      |  7.0.1\r\n| Operating system |  Windows\r\n"},"comment":{"url":"https://api.github.com/repos/yiisoft/yii2/issues/comments/235253470","html_url":"https://github.com/yiisoft/yii2/issues/11322#issuecomment-235253470","issue_url":"https://api.github.com/repos/yiisoft/yii2/issues/11322","id":235253470,"user":{"login":"PowerGamer1","id":8275897,"avatar_url":"https://avatars.githubusercontent.com/u/8275897?v=3","gravatar_id":"","url":"https://api.github.com/users/PowerGamer1","html_url":"https://github.com/PowerGamer1","followers_url":"https://api.github.com/users/PowerGamer1/followers","following_url":"https://api.github.com/users/PowerGamer1/following{/other_user}","gists_url":"https://api.github.com/users/PowerGamer1/gists{/gist_id}","starred_url":"https://api.github.com/users/PowerGamer1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PowerGamer1/subscriptions","organizations_url":"https://api.github.com/users/PowerGamer1/orgs","repos_url":"https://api.github.com/users/PowerGamer1/repos","events_url":"https://api.github.com/users/PowerGamer1/events{/privacy}","received_events_url":"https://api.github.com/users/PowerGamer1/received_events","type":"User","site_admin":false},"created_at":"2016-07-26T12:32:41Z","updated_at":"2016-07-26T12:32:41Z","body":"> I also noticed  message  attribute will be ignored if you set multiple target attributes:\r\n ['a1', 'unique', 'targetAttribute' => ['a1', 'a2'], 'message' => 'Custom message']\r\n\r\nSince Yii2 2.0.9 when you set multiple target attributes `comboNotUnique` is used to customize error message instead of `message`."}}
{"actor":{"display_login":"PowerGamer1"}}