Closed GoogleCodeExporter closed 9 years ago
what is the result of usermodel->_userRoleTable ? It runs in User::relations().
It seems like the model is not able to determine the user_has_role table
correctly.
try so lowercase the Yii:App() to Yii::app() in the sourcecode (fixed in next
svn commit)
Your problems all occur with a non-default tablename. This is good, so the
Module
gets tested well in this environment :)..
Original comment by thyseus
on 18 Mar 2010 at 7:03
Here the function relations of User :
public function relations()
{
if (isset(Yii::app()->controller->module->userRoleTable))
$this->_userRoleTable = Yii::app()->controller->module->userRoleTable;
elseif (isset(Yii::App()->modules['user']['userRoleTable']))
$this->_tableName = Yii::App()->modules['user']['userRoleTable'];
else
$this->_userRoleTable = 'user_has_role';
return array(
'profile'=>array(self::HAS_ONE, 'Profile', 'user_id'),
'roles'=>array(self::MANY_MANY, 'Role', $this->_userRoleTable . '(user_id, role_id)'),
);
}
And $this->_tableName = Yii::App()->modules['user']['userRoleTable']; should
be
$this->_userRoleTable = Yii::App()->modules['user']['userRoleTable']; like the
two
others !
Thanks
Original comment by christop...@gmail.com
on 18 Mar 2010 at 7:28
bug fixed in latest svn
Original comment by thyseus
on 19 Apr 2010 at 7:15
Original issue reported on code.google.com by
christop...@gmail.com
on 18 Mar 2010 at 6:45