PHP notice

Trying to get property of non-object

/home/pi888/public_html/protected/components/PageViewController.php(67)

55 
56         $uri = Yii::app()->request->requestUri;
57         $lang = Yii::app()->language;
58         $model = null;
59         //drugs
60         $prefix = Yii::app()->config->get('prefix.drug');
61         if($model === null && ($prefix  == '' or preg_match('@^/'.$prefix.'/@', $uri))) {
62 
63             $id = Drugs::findByLSlug($slug, $lang);
64             if($id){
65                 $model=Drugs::model()->findByPk($id);
66 
67                 if($model->active == 0){
68                     throw new CHttpException(404,'The requested page does not exist.');
69                 }
70                 if($model->drugname == false){
71                     throw new CHttpException(404,'The requested page does not exist.');
72                 }
73             } 
74         }
75 
76         // posts
77         $prefix = Yii::app()->config->get('prefix.article');
78         if($model === null && ($prefix  == '' or preg_match('@^/'.$prefix.'/@', $uri))) {
79             $model=Articles::model()->findByAttributes(array('slug' => $slug));

Stack Trace

#0
+
 /home/pi888/public_html/protected/components/PageViewController.php(16): PageViewController->loadModelBySlug("levitra-super-active.html")
11         if(preg_match('@^_@', $slug)){
12             throw new CHttpException(404,'The requested page does not exist.');
13         }
14 
15 
16         $model = $this->loadModelBySlug($slug);
17 
18         $domain = $this->domain;
19 
20         $this->pageTitle = $model->title;
21         $this->keywords = $model->keywords;
#15
+
 /home/pi888/public_html/index.php(54): CApplication->run()
49 
50 // change the following paths if necessary
51 $yii=dirname(__FILE__).'/framework/yii.php';
52 
53 require_once($yii);
54 Yii::createWebApplication($config)->run();
2024-03-29 05:09:46 Apache/2.4.57 (Unix) OpenSSL/1.0.2k-fips Yii Framework/1.1.14