#6414: find() didn't load data in "Multiple Select Box" when the table name in a HABTM relationship is underscored -------------------------------------------+-------------------------------- Reporter: Ammamon | Type: Bug Status: new | Priority: Medium Milestone: 1.2.x.x | Component: View Version: 1.2 Final | Severity: Normal Keywords: multiple select find habtm | Php_version: PHP 5 Cake_version: | -------------------------------------------+-------------------------------- '''Scenario:'''
I initially defined a HABTM relationship for say, two tables with names "groups" and "card_users". Then I created the following action and view for GroupsController as follows: ---- Action: function add() { if (!empty($this->data)) { $this->Group->create(); $this->Group->save($this->data); ... } $cardusers = $this->Group->CardUser->find('list'); $this->set('cardusers', $cardusers); } ---- add.ctp: <?php echo $form->create('Group');?> <fieldset> <legend>Add new Group</legend> <?php echo $form->input('group_name'); echo $form->input('CardUser'); ?> </fieldset> <?php echo $form->end('Submit');?> ---- '''Issue:''' The Select Box in the view was found not loaded with data. But data was loaded when I used the scaffolding option. '''How I did a temporary fix:''' I renamed the underscored table to "cardusers". And in the view, I changed the field name of the Form input method to Carduser. It worked then. -- Ticket URL: <https://trac.cakephp.org/ticket/6414> CakePHP : The Rapid Development Framework for PHP <https://trac.cakephp.org/> Cake is a rapid development framework for PHP which uses commonly known design patterns like ActiveRecord, Association Data Mapping, Front Controller and MVC. Our primary goal is to provide a structured framework that enables PHP users at all levels to rapidly develop robust web applications, without any loss to flexibility. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "tickets cakephp" group. To post to this group, send email to tickets-cakephp@googlegroups.com To unsubscribe from this group, send email to tickets-cakephp+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/tickets-cakephp?hl=en -~----------~----~----~----~------~----~------~--~---