cakephp-captcha icon indicating copy to clipboard operation
cakephp-captcha copied to clipboard

validate error on other field

Open anyway111 opened this issue 10 years ago • 2 comments

I use cakephp-captcha for login form, when i have not use cakephp-captcha i can login normal. but after i use it i can't login rule isUnique of email that apply. although, i use $this->User->validator()->remove('email', 'isUnique') for remove rule isUnique but it can not remove. i think because in method beforeValidate() of CaptchaBehavior. it's setting $model->validate include rule isUnique. how do remove it?

anyway111 avatar Feb 08 '16 10:02 anyway111

It is setting a new rule validateCaptcha in the beforeValidate() function of captcha behavior. I am not sure what problem you are facing though. Do I have a link to view it or the code you are putting there?

inimist avatar Feb 08 '16 10:02 inimist

I have fix it by use $model->validator()->remove('email', 'isUnique') in method beforeValidate() of CaptchaBehavior to remove it. although, this is a temporary solution, if i want to use CaptchaBehavior for other Model it's not favorable I think you can add a logic to remove rule from Controller if users whose want so.

anyway111 avatar Feb 08 '16 11:02 anyway111