Hello,
I have a problem with requestAction when I change cakephp version from
1.2.0.7692 to 1.2.1.8004.
I have this relations into Models that make a hasAndBelongsToMany from
Roles table and Tabs table (in the join table I have 2 fileds more:
position and active) :

class RolesTab extends AppModel {

        var $name = 'RolesTab';

        //The Associations below have been created with all possible keys,
those that are not needed can be removed
        var $belongsTo = array(
                        'Role' => array('className' => 'Role',
                                                                'foreignKey' => 
'role_id',
                                                                'conditions' => 
'',
                                                                'fields' => '',
                                                                'order' => ''
                        ),
                        'Tab' => array('className' => 'Tab',
                                                                'foreignKey' => 
'tab_id',
                                                                'conditions' => 
'',
                                                                'fields' => '',
                                                                'order' => ''
                        )
        );
}


class Role extends AppModel {

        var $name = 'Role';

        //The Associations below have been created with all possible keys,
those that are not needed can be removed


        var $hasAndBelongsToMany = array(
                        'Tab' => array('className' => 'Tab',
                                                'joinTable' => 'roles_tabs',
                                                'foreignKey' => 'role_id',
                                                'associationForeignKey' => 
'tab_id',
                                                'unique' => true,
                                                'conditions' => '',
                                                'fields' => '',
                                                'order' => '',
                                                'limit' => '',
                                                'offset' => '',
                                                'finderQuery' => '',
                                                'deleteQuery' => '',
                                                'insertQuery' => ''
                        )
        );
}

class Tab extends AppModel {

        var $name = 'Tab';

        var $hasAndBelongsToMany = array(
                        'Role' => array('className' => 'Role',
                                                'joinTable' => 'roles_tabs',
                                                'foreignKey' => 'tab_id',
                                                'associationForeignKey' => 
'role_id',
                                                'unique' => true,
                                                'conditions' => '',
                                                'fields' => '',
                                                'order' => '',
                                                'limit' => '',
                                                'offset' => '',
                                                'finderQuery' => '',
                                                'deleteQuery' => '',
                                                'insertQuery' => ''
                        )
        );
        var $displayField = 'text';

}


In the roles_tabs_controller I have this method:

function gettabs() {

$dati = $this->RolesTab->find('all', array('conditions'=>array
('Role.id'=>1),'order' => 'position ASC' ) ) ;
ecc...
}

This is the only one method that I have found to retrive all the data:
tab, Role and rolesTab with order in rolesTab.
If I run gettabs action directly all is ok, but if I run this action
with requestAction into another controller (for example post
controller: $tabs = $this->requestAction(array
('controller'=>'roles_tabs','action'=>'gettabs')); )  the action runs
wihout the associated model (into the final array I don't have the tab
and role data).

If I work with 1.2.0.7692 cake version all is ok and the requestaction
return same result when I call gettabs directly.

What' the problem? Is a bug?

Thank's Mattia

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to