This is related to:
https://trac.cakephp.org/ticket/2200
Try this. Change this:
$fields = $object->loadInfo();
$data = array(
'fields' => array_combine($fields->extract('{n}.name'), $fields-
>extract('{n}.type')),
'key' => $object->primaryKey,
'validates' => (ife(empty($object->validate), array(),
array_keys($object->validate)))
);
To:
$fields = $object->loadInfo();
$data = array(
'fields' => ife((is_array($fields->value) &&
isset($fields->value[0]), array_combine($fields->extract('{n}.name'),
$fields-
>extract('{n}.type')), array()),
'key' => $object->primaryKey,
'validates' => (ife(empty($object->validate), array(),
array_keys($object->validate)))
);
}
If it works, submit a patch for it.
-MI
---------------------------------------------------------------------------
Remember, smart coders answer ten questions for every question they ask.
So be smart, be cool, and share your knowledge.
BAKE ON!
blog: http://www.MarianoIglesias.com.ar
-----Mensaje original-----
De: [email protected] [mailto:[EMAIL PROTECTED] En nombre
de jcsiegrist
Enviado el: Viernes, 09 de Marzo de 2007 01:29 p.m.
Para: Cake PHP
Asunto: Problem using $form->create() with a model having var $useTable =
false (cake 1.2)
I'm trying to implement a simple form to be used for emailing. I'm
using a model with var $useTable = false to take advantage of the
validation features.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---