http://groups.google.com/group/cake-php/browse_thread/thread/4f462c16187e9c99/96cc07bb376797b2?tvc=2#96cc07bb376797b2
On Aug 18, 5:10 pm, Andy <[email protected]> wrote: > Greetings, all, > I'm working on a CMS based on CakePHP and I've been enjoying > working with Cake so far. However, I'm having some issues saving > information. My CMS has a normal post-oriented setup in which each > post can be related to multiple tags and multiple categories. I've set > up the associations correctly in the models and the views generated by > Bake seem to work fine. > > However, I'm using a custom client and building my array inside the > client. The client has the capability of adding new tags to each post, > then saving the tags at the same time as the post. However, when I try > to save all the data, it fails to save either the categories or the > tags. > > Here's an example of the array that the client generates: > > [Post] => Array > ( > [user_id] => 11 > [posted] => 2009-08-18 10:20:00 > [title] => This is a Great Post! > [comments_allowed] => 1 > [media_id] => 1 > [slug] => this-is-a-great-post > [seo_title] => SEO rocks. > [status] => 1 > [created] => 2009-08-18 10:25:53 > [id] => 2 > [content] => whatever > ) > > [Category] => Array > ( > [0] => Array > ( > [id] => 1 > [name] => Latest News > [slug] => news > ) > > [1] => Array > ( > [id] => 3 > [name] => Stuff > [slug] => stuff > ) > > ) > > [Tag] => Array > ( > [0] => Array > ( > [id] => 3 > [name] => college > [slug] => college > ) > > [1] => Array > ( > [name] => snap > [slug] => snap > ) > > [2] => Array > ( > [name] => fish > [slug] => fish > ) > > ) > > Right now I'm passing this into Cake and doing a saveAll() call. It > saves the post correctly, but erases all related tags and categories. > Would you all have any comments or suggestions on what I need to do to > get this working correctly? Thanks for your time! > > ~Andy --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
