I’ve got a form with a captcha code, and every time I try to submit the form with the correct captcha code, the validator says, that the code is wrong. This happens in 2 of 4 forms. The 2 forms (which doesn’t accept the right code are part of modules), the other 2 form (which work fine) are not in modules.
Any suggestions what’s wrong, or how to debug this issue?
i still couldn’t figure out what’s going wrong there, but i think this must be a problem of the current release, becuase in two other projects of mine (where i haven’t updated the framework) it works very well.
i hope the developers of yii could help solving this problem!
I’m not trying to use captcha through different controllers. The problem only occures when I use captcha in a form which belongs to a module. Using captcha with forms which doesn’t belong to a module works fine.
Okay, here is how it works for me now with the reCaptcha plugin.
public function actionRegister()
$form = new User();
$form->scenario = 'registerwcaptcha';
// and here is the actual HACKY part
$form->scenario = NULL;
// save user registration
public function rules()
'privateKey'=> ENVII_CAPTCHA_PRIVATE_KEY, 'on' => 'registerwcaptcha'
And it works like a charm, [color="#FF0000"]FAILS[/color] and [color="#006400"]PASSES[/color] when it has to