Error

Call to a member function getTitle() on null

/var/www/vhosts/halilhilmizade.com.tr/httpdocs/protected/modules/products/controllers/front/DefaultController.php(140)

128     $models=Product::model()->findAll($criteria);
129 
130     $this->render('category',array('cat'=>$cat,'products'=>$models,'slug'=>$category,'list'=>$pusuruk,'pages'=>$pages));
131 }
132 
133 function actionShow($id) {
134     $product = Product::model()->findByAttributes(array('slug' => $id));
135     $category = ProductCategory::model()->findByAttributes(array('id' => $product->category_id));
136     $other = Product::model()->findAllByAttributes(array('category_id' => $product->category_id));
137 
138     $this->breadcrumbs[Yii::t("front","product")] = Yii::app()->baseUrl . '/urunler';
139     $this->breadcrumbs[$category->title] = Yii::app()->baseUrl . '/urunler/kategori/'.$category->slug;
140     $this->pageTitle  = $product->getTitle();
141 
142     $this->render('show', array(
143      'product' => $product,
144      'category' => $product->category,
145      'other' => $other
146  ));
147 }
148 }

Stack Trace

#9
+
 /var/www/vhosts/halilhilmizade.com.tr/httpdocs/protected/components/WebApplicationEndBehavior.php(32): CApplication->run()
27         // Attach the changeModulePaths event handler
28         // and raise it.
29         $this->onModuleCreate = array($this, 'changeModulePaths');
30         $this->onModuleCreate(new CEvent($this->owner));
31 
32         $this->owner->run(); // Run application.
33     }
34 
35     // This event should be raised when CWebApplication
36     // or CWebModule instances are being initialized.
37     public function onModuleCreate($event)
#11
+
 /var/www/vhosts/halilhilmizade.com.tr/httpdocs/index.php(26): CComponent->__call("runEnd", array("front"))
21         return parent::init();
22     }
23 }
24 //$_SERVER['HTTPS']='on';
25 $app = new kraftCMS($config);
26 $app->runEnd('front');
2024-03-19 10:45:53 Apache Yii Framework/1.1.19