I have a problem i would like to solve and appreciate any help
here it goes:
In my application i have two models: Project and User.
What im trying to do is when a user creates a project, i want to increment a property of the user createdProjects+1.
So, what i did was in the ProjectController:
public function actionCreate()
$modelProject = new Project;
$modelUser = User::model()->findByPk(Yii::app()->user->id);
//gets the model of the user Logged
$modelUser->createdProjects = $modelUser->createdProjects + 1;
An Exception is thrown:
"CCaptchaValidator.action "captcha" is invalid. Unable to find such an action in the current controller."
in the line [color="#8B0000"]$modelUser->save()[/color] when i try to update the User counter.
The error message say “CCaptchaValidator”… so you have “some” problem with this validator… what I asked you is if you have that validatior in your model validation rules or maybe it’s there by error… if you have it… than you need to have the action “captcha” defined in your controller… do you have it?
For an example… check the default code generated by Gii… the captcha validator is used in the model ContactForm and the "captcha" action is defined in the controller SiteController.