M
M
Maxim2014-01-05 20:40:21
Yii
Maxim, 2014-01-05 20:40:21

Invalid CUniqueValidator. Where is the mistake?

Rule: There is an entry in the table with username = Frapsy, but the validator reports an error if you try to register with username = Fraps, Frap, Fra, that is, with similar ones. Where is the mistake?
array('username','unique','className'=>'Users'),

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander Zelenin, 2014-01-05
@zelenin

https://github.com/yiisoft/yii/blob/1.1.14/framewo...
have you looked at the validator code? you can debug it and find the error in 5 minutes

A
Alexey Kupreichik, 2014-01-06
@plusodinminus

attributeName is not specified, but should be

array('username', 'unique', 'className' => 'Users', 'attributeName' => 'username'),

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question