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
Describe the bug
We can validate Model by several fields at once, for example, by Uniqueness validator. But if the filter is producing an error, we can't get only this message by calling Model::getMessages(['field1', 'field2']) because internal implementation allows only strings as messages filter:
publicfunctiongetMessages(var filter = null) -><MessageInterface[]>
{
var message;
array filtered;
iftypeof filter ==="string"&&!empty filter {
let filtered = [];
for message inthis->errorMessages {
if message->getField() == filter {
let filtered[] = message;
}
}
return filtered;
}
returnthis->errorMessages;
}
To Reproduce
Steps to reproduce the behavior:
$model->getMessages(['login', 'loginType']); // Returns all Model messages, not just the ones I need
Describe the bug
We can validate Model by several fields at once, for example, by Uniqueness validator. But if the filter is producing an error, we can't get only this message by calling Model::getMessages(['field1', 'field2']) because internal implementation allows only strings as messages filter:
To Reproduce
Steps to reproduce the behavior:
Expected behavior
I expect to get messages related to the specified pair of fields.
Details
The text was updated successfully, but these errors were encountered: