PHP notice

Trying to get property 'lesson_id' of non-object

/home/548580.cloudwaysapps.com/kepyvjhsab/public_html/protected/controllers/SiteController.php(1559)

1547             $uvot['p'][$comment_id][0] = "#";
1548             $uvot['p'][$comment_id][1] = h::t('site', "Pentru a vota o intrebare trebuie sa fiti autentificat!");
1549             $uvot['n'][$comment_id][0] = "#";
1550             $uvot['n'][$comment_id][1] = h::t('site', "Pentru a vota impotriva intrebarii trebuie sa fiti autentificat!");
1551         }
1552     }
1553 
1554     public function actionTest() {
1555         $url = substr(Yii::app()->request->pathInfo, strpos(Yii::app()->request->pathInfo, "/") + 1);
1556         $testtid = Testeval::model()->find("`url`='$url'");
1557         $id = (!empty($testtid)) ? $testtid->id : 1;
1558         $test = Testeval::model()->findByPk($id);
1559         $lectie = Lesson::model()->findByPk($test->lesson_id);
1560         $unit = Unit::model()->findByPk($lectie->unit_id);
1561         $disciplina = Discipline::model()->findByPk($unit->discipline_id);
1562         $continlec = Lessonstr::model()->findAll(array('condition' => "lesson_id=:id", 'order' => "`order` ASC", 'params' => array(":id" => $lectie->id)));
1563         //$ulectii = Lesson::model()->findAll("unit_id=:id AND active=:val", array(":id" => 1, ":val" => '1'));
1564         //h::debug($id);
1565         //Yii::app()->session['user_id']=1;
1566         $qnumber = NULL;
1567         $variante = NULL;
1568         $intrebare = NULL;
1569         $indicatii = NULL;
1570         $answer = (isset($_POST['answer'])) ? $_POST['answer'] : NULL;
1571         $uindicatii = (isset($_POST['indicatii'])) ? $_POST['indicatii'] : NULL;

Stack Trace

#7
+
 /home/548580.cloudwaysapps.com/kepyvjhsab/public_html/index.php(13): CApplication->run()
08 defined('YII_DEBUG') or define('YII_DEBUG',true);
09 // specify how many levels of call stack should be shown in each log message
10 defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3);
11 
12 require_once($yii);
13 Yii::createWebApplication($config)->run();
2024-03-28 23:52:20 Apache/2.4.58 (Debian) Yii Framework/1.1.14