I've figure out the problem

It won't work with validation disabled:
return $this->save($data, false);

If the validation is turned on it works:
return $this->save($data);


You think it's a bug? Should I submit a ticket?



On Oct 6, 5:16 pm, red <mbu...@gmail.com> wrote:
> Hello,
> I'm trying to save translated content in model:
>
> class Page extends AppModel {
>         public $actsAs = array(
>                 'Translate' => array(
>                         'name' => 'nameTranslation'
>                 ),
>         );
>
>         public function createRoot($shop_id) {
>                 $data = array(
>                         'shop_id' => $shop_id,
>                         'parent_id' => '',
>                         'name' => array('eng' => 'Root', 'pol' => 'Korzen'),
>                         'active' => 1,
>                 );
>
>                 return $this->save($data, false);
>         }
>
> }
>
> And I'm getting error:
> Notice (8): Array to string conversion [CORE/cake/libs/model/
> datasources/dbo_source.php, line 608
> Warning (512): SQL Error: 1054: Unknown column 'Array' in 'field
> list' [CORE/cake/libs/model/datasources/dbo_source.php, line 549]
> Query: INSERT INTO `pages` (`shop_id`, `parent_id`, `name`, `active`,
> `modified`, `created`, `lft`, `rght`) VALUES (30, NULL, Array, 1,
> '2009-10-06 17:15:12', '2009-10-06 17:15:12', 3, 4)
>
> Looks like with this line is something wrong:
> 'name' => array('eng' => 'Root', 'pol' => 'Korzen'),
>
> Any ideas?
--~--~---------~--~----~------------~-------~--~----~
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+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to