PHP warning

Undefined array key "user_status"

/media/shnoulle/data/webdev/master/application/models/User.php(136)

124 
125             // created as datetime default current date in create scenario ?
126             // modifier as datetime default current date ?
127             array('validation_key', 'length','max' => self::MAX_VALIDATION_KEY_LENGTH),
128             //todo: write a rule for date (can also be null)
129             //array('lastForgotPwEmail', 'numerical', 'integerOnly' => true, 'allowEmpty' => true),
130         );
131     }
132 
133     /** @inheritdoc */
134     public function scopes()
135     {
136         $userStatusType = \Yii::app()->db->schema->getTable('{{users}}')->columns['user_status']->dbType;
137         $activeScope = array(
138             'condition' => 'user_status = :active',
139             'params' => array(
140                 'active' => $userStatusType == 'boolean' ? 'TRUE' :  '1',
141             )
142         );
143 
144         $notExpiredScope = array(
145             'condition' => "expires > :now OR expires IS NULL",
146             'params' => array(
147                 'now' => dateShift(date("Y-m-d H:i:s"), "Y-m-d H:i:s", Yii::app()->getConfig("timeadjust")),
148             )

Stack Trace

#1
+
 /media/shnoulle/data/webdev/master/application/core/Traits/LSApplicationTrait.php(33): CActiveRecord->__call("notexpired", array())
28         if (!is_null($this->currentUserId) && $this->currentUserId == App()->session['loginID']) {
29             return $this->currentUserId;
30         }
31         /* use App()->session and not App()->user fot easiest unit test */
32         $this->currentUserId = App()->session['loginID'];
33         if ($this->currentUserId && !User::model()->notexpired()->active()->findByPk($this->currentUserId)) {
34             $this->currentUserId = 0;
35         }
36         return $this->currentUserId;
37     }
38 
#2
+
 /media/shnoulle/data/webdev/master/application/core/LSWebUser.php(25): LSYii_Application->getCurrentUserId()
20     public function getId()
21     {
22         if (empty(parent::getId())) {
23             return parent::getId();
24         }
25         $id = App()->getCurrentUserId();
26         if ($id === 0) {
27             /* User is still connected but invalid : logout */
28             $this->logout();
29         }
30         return $id;
#3
+
 /media/shnoulle/data/webdev/master/application/controllers/AdminController.php(39): LSWebUser->getId()
34     {
35         parent::customInit();
36         App()->getComponent('bootstrap');
37         $this->sessioncontrol();
38 
39         $this->user_id = Yii::app()->user->getId();
40         // Check if the user really exists
41         // This scenario happens if the user was deleted while still being logged in
42         if (!empty($this->user_id) && User::model()->findByPk($this->user_id) == null) {
43             $this->user_id = null;
44             Yii::app()->session->destroy();
2025-06-23 15:18:47 nginx/1.22.1 Yii Framework/1.1.30