PHP notice

Trying to get property of non-object

/srv/www/sudyirossii/protected/views/nepravo/view.php(16)

04 
05 $title = array(1=>'Неправосудные решения',2=>'Статьи о судебной власти РФ',3=>'Открытое письмо президенту России',4=>'Открытое письмо председателю верховного суда');
06 
07 $this->breadcrumbs=array(
08     $title[$post->type]=>'/nepravo/index/type/'.$types[$post->type]['code'],
09     $post->title
10 );
11 
12 ?>
13 
14 <h1><?php echo $post->title; ?></h1>
15 <? $this->renderPartial('../site/_approve', array('post'=>$post)); ?>
16 <span class="detail" style="font-size:14px;"><b>Отправитель: </b><? echo $post->user ? '<a href="/users/view/'.$post->user.'">'.Users::model()->findByPk($post->user)->name.'</a>' : $post->name; ?></span>
17 <span class="detail" style="font-size:14px;"><b>Опубликовано: </b><? echo substr($post->date,0,10) ?></span>
18 <? $post->views = $post->views + 1; $post->save() ?>
19 <span class="detail" style="font-size:14px;"><b>Просмотров: </b><? echo $post->views ?></span>
20 <div class="art"><? echo nl2br($post->text) ?></div>
21 <?
22 $attach = Files::model()->findAllByAttributes(array('article_id'=>$post->id));
23 if(count($attach)):
24 ?>
25 <span class="attach_title">Прикреплённые файлы:</span>
26 <div class="attached_files">
27 <?
28 foreach($attach as $v){

Stack Trace

#4
+
 /srv/www/sudyirossii/protected/components/Controller.php(133): CController->render("view", array("post" => Nepravo, "comment" => Comments, "schema" => array("@context" => "https://schema.org", "@type" => "Article", "author" => "", "name" => "Это рыба тухнет с головы, а не судеб...", ...), "openGraph" => array("title" => "Это рыба тухнет с головы, а не судеб...", "description" => "Судебный деперсонифицированный ак...")))
128         $this->render($render, array(
129             'post'=>$post,
130             'comment' => $comment,
131             'schema' => $schema,
132             'openGraph' => $openGraph,
133         ));
134 
135         return $comment;
136     }
137 
138     public function current(){
#5
+
 /srv/www/sudyirossii/protected/controllers/NepravoController.php(40): Controller->newComment(7, Nepravo, "view", array("@context" => "https://schema.org", "@type" => "Article", "author" => "", "name" => "Это рыба тухнет с головы, а не судеб...", ...))
35             '@type' => 'Article',
36             'author' => !empty($user) ? Users::model()->findByPk($post->user)->name : '',
37             'name' => $post->title,
38             'description' => StringTools::truncate($post->text, 300),
39         ];
40         $this->newComment(7, $post, 'view', $schema);
41 
42     }
43 
44     /**
45      * Creates a new model.
#20
+
 /srv/www/sudyirossii/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 
25 require_once($yii);
26 Yii::createWebApplication($config)->run();
27 }else{
28 ?>
29 
30 <html>
31 <head>
2024-03-29 04:30:07 Apache/2.4.52 (Ubuntu) Yii Framework/1.1.14