Role is not working

I upgrade Yii 1.0 to 1.1 but Role is not working. I got this error

CDbCommand failed to execute the SQL statement: SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘User.id’ in ‘where clause’

#5 ../../components/Auth.php(13): CActiveFinder->find(‘User.id=?’, Array)

Source File

../../yii/framework/db/CDbCommand.php(375)

00363: }

00364:

00365: if($this->_connection->enableProfiling)

00366: Yii::endProfile(‘system.db.CDbCommand.query(’.$this->getText().’)’,‘system.db.CDbCommand.query’);

00367:

00368: return $result;

00369: }

00370: catch(Exception $e)

00371: {

00372: if($this->_connection->enableProfiling)

00373: Yii::endProfile(‘system.db.CDbCommand.query(’.$this->getText().’)’,‘system.db.CDbCommand.query’);

00374: Yii::log('Error in querying SQL: '.$this->getText().$par,CLogger::LEVEL_ERROR,‘system.db.CDbCommand’);

00375: throw new CDbException(Yii::t(‘yii’,‘CDbCommand failed to execute the SQL statement: {error}’,

00376: array(’{error}’=>$e->getMessage())));

00377: }

00378: }

00379: }


in my /component/Auth.php

$user=User::model()->with(‘role’)->find(‘User.id=?’,array(Yii::app()->user->getId()));

Do I need to change this line? Plz let me know.

Try t.id instead of User.id

/Tommy

Thanks Buddy. It’s working. :rolleyes: