PHP warning

Creating default object from empty value

/home/clients/96783d319dc1f0128a5b46d24607d33e/sites/jobactif.ch/web/protected/views/annonces/annonce.php(21)

09     $annonce->indexFieldsData();
10     $annonce->save();
11 }    
12 
13 $entreprise = User::model()->findByPk($annonce->idUser);
14 
15 $this->_pageType = 'article';
16 $this->setPageTitle($annonce->titre);
17 $this->setPageDescription($annonce->meta_description);
18 
19 $lieux = array();
20 if($annonce->canton=="") {
21     $annonce->canton = 0;
22 }
23 /* else
24 if (intval($annonce->canton) == $annonce->canton) {
25     echo 'mmm: '. intval($annonce->canton) . ' == ' .$annonce->canton . ' ?';
26     $c = json_decode($annonce->canton);
27     print_r($c);
28     $annonce->canton = $c[0];
29 }
30 else {
31     echo 'oops';
32 echo $annonce->canton;
33 echo intval($annonce->canton);

Stack Trace

#3
+
 /home/clients/96783d319dc1f0128a5b46d24607d33e/sites/jobactif.ch/web/protected/views/annonces/liste.php(205): CController->renderPartial("annonce", array("annonce" => null))
200         <div class="panel panel-default">
201             <?php
202             if ($annonces) {
203                 if (!$selected)
204                     $annonce = $annonces[0];
205                 $this->renderPartial('annonce', array('annonce' => $annonce));
206             }
207             ?>
208         </div>
209     </div>
210 </div>
#7
+
 /home/clients/96783d319dc1f0128a5b46d24607d33e/sites/jobactif.ch/web/protected/views/annonces/index.php(33): CController->renderPartial("liste", array("mode" => "get", "annonces" => array(null), "pages" => null, "count" => null, ...))
28         $v['search_id'] = $search_id;
29     
30     if (isset($recorded_search))
31         $v['recorded_search'] = $recorded_search;
32 
33     $this->renderPartial('liste', $v);
34 }
35 else {
36     ?>
37     <div class="alert alert-info text-center">
38         Aucune annonce trouvée avec ces critères de recherche
#12
+
 /home/clients/96783d319dc1f0128a5b46d24607d33e/sites/jobactif.ch/web/protected/controllers/AnnoncesController.php(401): CController->render("index", array("annonces" => array(null), "mode" => "get"))
396         
397         //
398         if ($annonce->url && $_SERVER['REQUEST_URI'] == '/annonces/get/id/' . $id)
399             $this->redirect('/annonce/' . $annonce->url, true, 301);
400         
401         $this->render('index', ['annonces' => [$annonce], 'mode' => 'get']);
402     }
403 
404     /*
405      *    Affiche une annonce spécifique
406      */
2024-03-28 19:56:24 Apache Yii Framework/1.1.15
Journal d'application
Heure Niveau Categorie Message
19:56:24.694936 error php
Creating default object from empty value
(/home/clients/96783d319dc1f0128a5b46d24607d33e/sites/jobactif.ch/web/protected/views/annonces/annonce.php:21)
Stack trace:
#0
/home/clients/96783d319dc1f0128a5b46d24607d33e/sites/jobactif.ch/web/framework/web/CController.php(869):
AnnoncesController->renderFile()
#1
/home/clients/96783d319dc1f0128a5b46d24607d33e/sites/jobactif.ch/web/protected/views/annonces/liste.php(205):
AnnoncesController->renderPartial()
#2
/home/clients/96783d319dc1f0128a5b46d24607d33e/sites/jobactif.ch/web/framework/web/CBaseController.php(126):
require()
#3
/home/clients/96783d319dc1f0128a5b46d24607d33e/sites/jobactif.ch/web/framework/web/CBaseController.php(95):
AnnoncesController->renderInternal()
#4
/home/clients/96783d319dc1f0128a5b46d24607d33e/sites/jobactif.ch/web/framework/web/CController.php(869):
AnnoncesController->renderFile()
#5
/home/clients/96783d319dc1f0128a5b46d24607d33e/sites/jobactif.ch/web/protected/views/annonces/index.php(33):
AnnoncesController->renderPartial()
#6
/home/clients/96783d319dc1f0128a5b46d24607d33e/sites/jobactif.ch/web/framework/web/CBaseController.php(126):
require()
#7
/home/clients/96783d319dc1f0128a5b46d24607d33e/sites/jobactif.ch/web/framework/web/CBaseController.php(95):
AnnoncesController->renderInternal()
#8
/home/clients/96783d319dc1f0128a5b46d24607d33e/sites/jobactif.ch/web/framework/web/CController.php(869):
AnnoncesController->renderFile()
#9
/home/clients/96783d319dc1f0128a5b46d24607d33e/sites/jobactif.ch/web/framework/web/CController.php(782):
AnnoncesController->renderPartial()
#10
/home/clients/96783d319dc1f0128a5b46d24607d33e/sites/jobactif.ch/web/protected/controllers/AnnoncesController.php(401):
AnnoncesController->render()
#11 unknown(0): AnnoncesController->actionGet()
#12
/home/clients/96783d319dc1f0128a5b46d24607d33e/sites/jobactif.ch/web/framework/web/actions/CAction.php(108):
ReflectionMethod->invokeArgs()
#13
/home/clients/96783d319dc1f0128a5b46d24607d33e/sites/jobactif.ch/web/framework/web/actions/CInlineAction.php(47):
CInlineAction->runWithParamsInternal()
#14
/home/clients/96783d319dc1f0128a5b46d24607d33e/sites/jobactif.ch/web/framework/web/CController.php(308):
CInlineAction->runWithParams()
#15
/home/clients/96783d319dc1f0128a5b46d24607d33e/sites/jobactif.ch/web/framework/web/filters/CFilterChain.php(133):
AnnoncesController->runAction()
#16
/home/clients/96783d319dc1f0128a5b46d24607d33e/sites/jobactif.ch/web/framework/web/filters/CFilter.php(40):
CFilterChain->run()
#17
/home/clients/96783d319dc1f0128a5b46d24607d33e/sites/jobactif.ch/web/framework/web/CController.php(1145):
CAccessControlFilter->filter()
#18
/home/clients/96783d319dc1f0128a5b46d24607d33e/sites/jobactif.ch/web/framework/web/filters/CInlineFilter.php(58):
AnnoncesController->filterAccessControl()
#19
/home/clients/96783d319dc1f0128a5b46d24607d33e/sites/jobactif.ch/web/framework/web/filters/CFilterChain.php(130):
CInlineFilter->filter()
#20
/home/clients/96783d319dc1f0128a5b46d24607d33e/sites/jobactif.ch/web/framework/web/CController.php(291):
CFilterChain->run()
#21
/home/clients/96783d319dc1f0128a5b46d24607d33e/sites/jobactif.ch/web/framework/web/CController.php(265):
AnnoncesController->runActionWithFilters()
#22
/home/clients/96783d319dc1f0128a5b46d24607d33e/sites/jobactif.ch/web/framework/web/CWebApplication.php(282):
AnnoncesController->run()
#23
/home/clients/96783d319dc1f0128a5b46d24607d33e/sites/jobactif.ch/web/framework/web/CWebApplication.php(141):
CWebApplication->runController()
#24
/home/clients/96783d319dc1f0128a5b46d24607d33e/sites/jobactif.ch/web/framework/base/CApplication.php(180):
CWebApplication->processRequest()
#25
/home/clients/96783d319dc1f0128a5b46d24607d33e/sites/jobactif.ch/web/index.php(18):
CWebApplication->run()
REQUEST_URI=/annonces/get/id/141