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
has_field 'id'=> (
type=>'Text',
required=> 1,
accessor=>'username',
unique=> 1,
messages=> {
required=>'username is required',
unique=>'This user name is already taken'
},
);
However, setting unique message dose not set $field->unique_message, then in this TraitFor::Model::DBIC(line 262), the unique message we get every time is "Duplicate value for [_1]". By using get_message('unique'), we can get the correct message.
return $self->unique_messages->{$constraint} ||= "Duplicate value for [_1] unique constraint" also suffers from the same problem, I did not dig into this part, so maybe there should be another fix.
The text was updated successfully, but these errors were encountered:
According to the HTML::FormHandler::Field document, the unique message is set by
eg:
However, setting unique message dose not set $field->unique_message, then in this TraitFor::Model::DBIC(line 262), the unique message we get every time is "Duplicate value for [_1]". By using get_message('unique'), we can get the correct message.
return $self->unique_messages->{$constraint} ||= "Duplicate value for [_1] unique constraint" also suffers from the same problem, I did not dig into this part, so maybe there should be another fix.
The text was updated successfully, but these errors were encountered: