Hi,
I think I’m missing something in order of how validators are executed (are they run in the same order as defined?) or how skipOnError works.
Definition of skipOnError says: "whether this validation rule should be skipped if when there is already a validation error for the current attribute". So, if I get it right, particular validator, that has this param set to true won’t be executed, if there are already other validation errors. Right?
I have this validation rules in one of my forms:
public function rules()
{
return array
(
array('password_current, password_new_one, password_new_two', 'required'),
array('password_current', 'authenticate', 'skipOnError'=>true), //Current password needs to be authenticated.
array('password_new_one', 'compare', 'compareAttribute'=>'password_new_two'),
array('password_current', 'compare', 'compareAttribute'=>'password_new_one', 'operator'=>'!='),
array('password_new_one', 'quality', 'skipOnError'=>true), //New password needs to follow quality rules.
);
}
In my own quality validator I put echo, that shows me whether this particular validator was or wasn’t fired.
I run test form validation, see message generated by second compare validator and… my echo message.
How can it be that my own validator was fired, if it has skipOnError set to true and if previous validator has already reported validation error?