Hi folks,
I inherited a Yii project that is working on a production server but I am seeing a mysterious error locally. I need help.
This is the error:
Fatal error: Cannot use object of type __PHP_Incomplete_Class as array in /var/www/myapp/app/protected/controllers/NotificationController.php on line 144
The culprit seems to be that the previous developer is trying to access an array value like this:
$user = $this->getLoginUser();
$user['role_id'];
The file private/components/Controller.php is defining getLoginUser() with this method:
public function setLoginUser() {
$this->loginUser = Yii::app()->session['primaryLoginUser'];
}
The problem is that if I try to print_r $user I get the following PHP Incomplete Class Object.
__PHP_Incomplete_Class Object
(
[__PHP_Incomplete_Class_Name] => users
[_md:CActiveRecord:private] =>
[_new:CActiveRecord:private] =>
[_attributes:CActiveRecord:private] => Array
(
[id] => 1
[role_id] => 1
[profile_pic_name] =>
[first_name] => Admin
[last_name] => Admin
)
[_related:CActiveRecord:private] => Array
(
)
[_c:CActiveRecord:private] =>
[_pk:CActiveRecord:private] => 1
[_alias:CActiveRecord:private] => t
[_errors:CModel:private] => Array
(
)
[_validators:CModel:private] =>
[_scenario:CModel:private] => update
[_e:CComponent:private] =>
[_m:CComponent:private] =>
)
So, how is it possible he is getting the value as an array in the production server? I can’t even get it with $user->role_id. Help?
I am using Ubuntu 14.04 with Nginx. Attached is my 5749