On Dec 7, 9:37 am, Rob Wilkerson <[EMAIL PROTECTED]> wrote: > I have a simple many to many relationship scaffolded up that isn't > working the way it should. I'm sure I'm missing something, but I can't > see what that something is and could use a sanity check. > > I have NavMenu and NavMenuItem models. Each of those > hasAndBelongsToMany of the other. In the database, I have a nav_menus > table, a nav_menu_items table and the linking table, > nav_menu_items_nav_menus. As far as I can tell, all of my naming > conventions are correct. Each of the primary tables has a field named > "id" and the linking table has the following fields: id, nav_menu_id, > nav_menu_item_id. > > When I load the scaffolding page to edit a NavMenu (e.g. /nav_menus/ > edit/4917839a-f064-447d-a492-0e733b196446), I see inputs for the > NavMenu properties and I also see a listbox to select the appropriate > menu items for the menu I'm editing. That would seem to indicate that > Cake is seeing everything correct, but when I select a few menu items > to be associated with the menu, the linking table isn't updated. All > other NavMenu fields can be updated as expected.
A little more information about this. I still don't understand the problem, but it seems that I can link 1 menu item to a menu (or 1 menu to a menu item, depending on which way I'm trying). As soon as I try to link the second, though, both records disappear from the linking table. I've tried this both with and without having an id field in the linking table with the same result. Does that help? I'm going to keep digging, but if anyone has any thoughts or ideas, I'd love to hear them. Thanks. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
