PHP notice

Trying to get property of non-object

/home/sectora70/public_html/protected/controllers/CatalogController.php(264)

252     public function actionView()
253     {
254         $id = Yii::app()->request->getParam('id');
255 //    $path = Yii::app()->request->getParam('path');
256 //    $domens = explode('/', trim($path, '/'));
257 //    $alias = array_slice($domens, -1);
258 
259         $row = Products::model()->findByPk($id);
260 
261         if (Yii::app()->request->getQuery('alias') == null) {
262             $this->redirect($id . '-' . $row->alias);
263         } elseif (Products::model()->findByAttributes(['alias' => Yii::app()->request->getQuery('alias')]) == null) {
264             $this->redirect($id . '-' . $row->alias);
265         }
266 
267 
268         if ($row->title) $this->pageTitle = $row->title;
269         if ($row->description) $this->desc = $row->description;
270         if ($row->keywords) $this->kw = $row->keywords;
271 
272         $category = Category::model()->findByPk($row->category->id);
273 
274         foreach ($category->ancestors()->findAll() as $ans) {
275             $this->breadcrumbs[$ans->name] = '/catalog/category/' . $ans->id;
276         }

Stack Trace

#7
+
 /home/sectora70/public_html/index.php(30): CApplication->run()
25 
26 defined('UPL_FR') or define('UPL_FR', '/uploads/');
27 defined('UPL_BK') or define('UPL_BK', __DIR__ . UPL_FR);
28 
29 require_once($yii);
30 Yii::createWebApplication($config)->run();
2024-03-19 13:22:25 LiteSpeed Yii Framework/1.1.15