I have the same problemm in my application and still working to resolve. P.S. There is something strange that happened these days (not upgrading CakePHP, PHP, MySQl .... etc) - now even when I "return false;" in beforeValidation() callback validation ot the models passes and tries to save invalid data. I can't understand why validation does continue while the callback return false ....
On Nov 7, 9:52 am, "R. Rajesh Jeba Anbiah" <[EMAIL PROTECTED]> wrote: > Previous discussions: > 1. http://groups.google.com/group/cake-php/browse_thread/thread/856cda8e... > 2.https://trac.cakephp.org/ticket/2473 > > Summary: > I still don't get it working. > > Case: > 1. add.ctp > $form->create('model1') > ... > $form->input('a'); > $form->input('b'); > $form->input('model2.x'); > > 2. controller1::add() > $this->model1->save($this->data); > $this->model1->model2->save($this->data['model2']); > > Problem: > 1. $form->input('model2.x'); doesn't render input field with required > class. Note, model2->validate['x'] is set with proper rules. > 2. From controller1::add() > $this->model1->model2->save($this->data['model2']) correctly shows the > validation error message in 'model2.x' > 3. *But*, from controller1::add() > $this->model1->model2->validates() doesn't show validation error > message in 'model2.x'--it always get validated. > > Side notes: > 1. Invalidating from controller1::add() seems to work. But, > $this->model1->model2->invalidate('x'); shows "1" next to the > 'model2.x' > > Does anyone know how to get it working? > > -- > <?php echo 'Just another PHP saint'; ?> > Email: rrjanbiah-at-Y!com Blog:http://rajeshanbiah.blogspot.com/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Cake PHP" 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 -~----------~----~----~----~------~----~------~--~---
