Check this model filename. Should be post_comment.php. This model may
be not loaded at all if you named it wrong. In this case $this-
>PostComment in controller will be of class AppModel and won't have
your validation rules, of course.

On Feb 9, 9:54 pm, Tomek Mazur <[email protected]> wrote:
> Nope. I tried this with other rules: minLength, maxLength and it
> always validates. It seems like the rules are simply ignored. It
> occours only in this one specific model. Don't know what's behind
> this...
>
> On 9 Lut, 15:49, Céryl <[email protected]> wrote:
>
>
>
> > Not sure but is there a chance that the username is an empty string
> > like "" or has a stray space perhaps? And therefore not considered
> > empty?
>
> > If not... Beats me! :D
>
> > On 8 feb, 17:31, Tomek Mazur <[email protected]> wrote:
>
> > > Hi,
>
> > > I have this weird problem. I set up validation rules but cake seems to
> > > ignore them. Here is my model and 
> > > controller:http://bin.cakephp.org/view/309506151
>
> > > I supply this data:
> > > Array
> > > (
> > >     [PostComment] => Array
> > >         (
> > >             [username] =>
> > >             [email] =>
> > >             [message] =>
> > >             [post_id] => 31
> > >         )
> > > )
>
> > > which obviously sould not validate, yet the first debug returns
> > > 'true'. This is driving me crazy, my controller is kind of 'nasty',
> > > because I was trying to debug the problem.

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 [email protected]
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to