thyseus / yii-user-management

a user management module collection for the yii framework
185 stars 122 forks source link

Cannot find friendship table in the db when user tries to write a message #44

Closed cmornard closed 12 years ago

cmornard commented 12 years ago

If the table name is not standard ('friendship'), Yum cannot find it even if it is properly configured in config/main.php

I believe there is a small error in friendship/models/YumFriendship.php. Patch suggested:

--- C:/yii-user-management_0.8rc6.tar/user/friendship/models/YumFriendship.php  Thu Apr 05 17:04:48 2012
+++ C:/yumtest/protected/modules/friendship/models/YumFriendship.php    Tue Oct 16 12:15:25 2012
@@ -113,7 +113,7 @@
    public function tableName()
    {
        if(isset(Yum::module('friendship')->friendshipTable))
-           $this->_tableName = Yum::module()->friendshipTable;
+           $this->_tableName = Yum::module('friendship')->friendshipTable;
    elseif(isset(Yii::app()->modules['user']['friendshipTable']))
        $this->_tableName = Yii::app()->modules['user']['friendshipTable'];
    else
            ...
thyseus commented 12 years ago

i will integrate your patch in my next commit. thanks for reporting !