Hello,
It appears that for some reason the message specified for unique validators do not show up when validation fails rather a generic message is shown?
Add a unique rule with a custom message to a model involving more than one column
When the rule fails the custom message provided in the rule should be displayed eg;
This Book and Author are already associated
A generic message like the following is displayed eg;
The combination "1"-"1" of Book, Author has already been taken.
| Q | A
| ---------------- | ---
| Yii version | 2.0.9
| PHP version |5.6
| Operating system |Linux/Ubuntu 14.04.3
public function rules()
{
return [
...
[['book_id', 'author_id'], 'unique', 'targetAttribute' => ['book_id', 'author_id'], 'message' => 'This Book and Author are already associated'],
...
];
}
Thanks @rob006, will update to 2.0.10 and provide feedback
Glad to report that updating to 2.0.10 resolved the issue, thanks
Most helpful comment
Thanks @rob006, will update to 2.0.10 and provide feedback