beforeValidation() and afterValidation() not working


it seems like the ActiveRecord-methods afterValidation() and beforeValidation() are broken.

Using it this way:

 public function beforeValidate() {

    if(parent::beforeValidate()) {

      // something happens here



or even only

 public function beforeValidate() { ; }

makes the Validation of my models always fail.

Setting my before-validation code in the Controller works, but i think this is not very elegant.

Or am i doing something wrong?

Thank you!

Did you forget to return true/false?

Yes, of course, this solved the problem. Thank you.

Is this documented somewhere? (except in the API) :)

Also, possibly better, make sure you are not calling the


method with the parameter set to false and you can

return parent::beforeValidate();

in your own before validate, this will make sure everything gets executed, might not fit your use-case just thought this might be useful.