On Oct 14, 4:36 am, Topper <[EMAIL PROTECTED]> wrote:
> Cake's version: 1.1.20.7692
>
> Hello. What you will read is something very weird that started to
> happen today in the app I am currently building. It's not my 1st cake
> app and I think I am not so newbie anymore. The story is:
>
> I have a model, product.php, that of course belongs to a products
> table. The table structure is:
>
> CREATE TABLE `products` (
> `id` int(11) unsigned NOT NULL auto_increment,
> `nombre` tinytext,
> `created` datetime NOT NULL default '0000-00-00 00:00:00',
> `modified` datetime NOT NULL default '0000-00-00 00:00:00',
> PRIMARY KEY (`id`)
> ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
>
> The product.php model code is:
>
> <?php
> class Product extends AppModel {
>
> var $name = 'Product';
>
> }
>
> ?>
>
> I have an "add" function in the products controller that saves some
> products. Everything worked neat, I added some products with the form,
> etc ... until I added the $validate to the model. Just adding this:
>
> <?php
> class Product extends AppModel {
>
> var $name = 'Product';
> var $validate = array(
> 'nombre' => VALID_NOT_EMPTY
> );
>
> }
>
> ?>
>
> ... and submitting the add form It literally KILLS my entire app (it
> starts showing no access pages or missing layout errors). It only
> solves after deleting the $validate lines and also deleting the
> browser's cache.
That sounds suspiciously like you have
$this->Session->setFlash('message', 'nonexistantlayout');
check in your controller if it passes validation, and if so dump the
session contents.
If you're convinced it's the validate function - debug it. although I
very much doubt that'll be the real cause.
hth,
AD
--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---