Error

Call to a member function ancestors() on null

/home/rb/www/rb22.ru/protected/controllers/CatalogController.php(107)

095 
096         $this->pageTitle = "$model->title. Купить $model->title в Барнауле, Алтайском крае по выгодной цене";
097         if($model->seo_title){
098             $this->pageTitle = $model->seo_title." | компания РайтБэнд";
099         }
100         if($model->seo_description){
101             $this->seo_description = $model->seo_description;
102         }
103         if($this->city == 'nsk'){
104             $this->pageTitle = str_replace('Барнаул', 'Новосибирск', $this->pageTitle);
105             $this->seo_description= str_replace('Барнаул', 'Новосибирск', $this->seo_description);
106         }
107         $parents = $category->ancestors()->findAll('is_visible=true AND level > 1');
108         foreach($parents as $parent){
109             $this->breadcrumbs[$parent->title] = array($parent->getUrl());
110         }
111         if($model->properties){
112             $properties = json_decode($model->properties,1);
113             if($properties && isset($properties[0]) && isset($properties[0][0])   && $properties[0][0] === ''){
114                 $model->properties = null;
115             }
116         }
117         $relatedGoods = [];
118         if($model->related){
119             $relations = explode(',', $model->related);

Stack Trace

#9
+
 /home/rb/www/rb22.ru/index.php(26): CApplication->run()
21 defined('YII_DEBUG') or define('YII_DEBUG',true);
22 // specify how many levels of call stack should be shown in each log message
23 defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);
24 require_once($yii);
25 
26 Yii::createWebApplication($config)->run();
2024-03-19 06:00:44 nginx/1.18.0 Yii Framework/1.1.25