Thursday, October 28, 2010

After upgrade to 1.3.5 validation rules don't seem to work

Hi,

ich upgraded my project to 1.3.5 and now my validation rules are not
working any more. I used the folllowing code with version 1.3.3 and it
worked just fine:

[code]

class User extends AppModel {
var $name = 'User';

var $validate = array(
'username' => array(
'email' => array(
'rule' => array('email'),
'message' => 'This is not a valid email address',
),
'notempty' => array(
'rule' => array('notempty'),
'message' => 'Please enter an email address',
),
'unique' => array (
'rule' => array('isUnique'),
'message' => 'Email Address is already in use',
),
),
'password' => array(
'notempty' => array(
'rule' => array('notempty'),
'message' => 'Password cannot be empty',
),
'minlength' => array(
'rule' => array('minLength', 7),
'message' => 'Password must have at least 7 characters',
),
),
'professionaltype' => array(
'numeric' => array(
'rule' => array('numeric'),
),
),
'birthday' => array(
'date' => array(
'rule' => array('date'),
),
),
);


[/code]

but now after upgrading it is not working anymore. The record is saved
with an empty username in the database.

Can anyone help?

thanks a lot,
Christian

Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.

You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

No comments: