PHP warning

Attempt to read property "folder" on null

E:\WEB\limesurvey\www\application\models\Template.php(433)

421         if (!is_null($aTemplateList)) {
422             return $aTemplateList;
423         }
424         $aTemplateList = [];
425         /* Get the template name by TemplateConfiguration and fiolder by template , no need other data */
426         $criteria = new CDBCriteria();
427         $criteria->select = 'template_name';
428         $criteria->with = ['template' => ['select' => 'folder']];
429         $oTemplateList = TemplateConfiguration::model()->with('template')->findAll($criteria);
430         $aTemplateInStandard = SurveyThemeHelper::getTemplateInStandard();
431         $aTemplateInUpload = SurveyThemeHelper::getTemplateInUpload();
432         foreach ($oTemplateList as $oTemplate) {
433             if (isset($aTemplateInStandard[$oTemplate->template->folder])) {
434                 $aTemplateList[$oTemplate->template_name] = $aTemplateInStandard[$oTemplate->template->folder];
435             } elseif (isset($aTemplateInUpload[$oTemplate->template->folder])) {
436                 $aTemplateList[$oTemplate->template_name] = $aTemplateInUpload[$oTemplate->template->folder];
437             }
438         }
439         return $aTemplateList;
440     }
441 
442     /**
443      * @return array
444      * TODO: replace the calls to that function by a data provider based on search
445      */

Stack Trace

#0
+
 E:\WEB\limesurvey\www\application\models\Template.php(263): Template::getTemplateList()
258      * @return bool
259      */
260     public static function checkIfTemplateExists($sTemplateName)
261     {
262         // isset is faster, and we need a value, no need array_key_exist here
263         return isset(self::getTemplateList()[$sTemplateName]);
264     }
265 
266     /**
267      * Get the template path for any template : test if template if exist
268      *
#1
+
 E:\WEB\limesurvey\www\application\models\Template.php(366): Template::checkIfTemplateExists("vanilla")
361      * @return string template url
362      */
363     public static function getTemplateURL($sTemplateName = "")
364     {
365         // Make sure template name is valid
366         if (!self::checkIfTemplateExists($sTemplateName)) {
367             throw new \CException("Invalid {$sTemplateName} template directory");
368         }
369 
370         static $aTemplateUrl = array();
371         if (isset($aTemplateUrl[$sTemplateName])) {
#2
+
 E:\WEB\limesurvey\www\application\models\TemplateConfig.php(110): Template::getTemplateURL("vanilla")
105      * @return string template url
106      */
107     public function getTemplateURL()
108     {
109         if (!isset($this->sTemplateurl)) {
110             $this->sTemplateurl = Template::getTemplateURL($this->sTemplateName);
111         }
112         return $this->sTemplateurl;
113     }
114 
115 
2024-03-29 15:29:25 Microsoft-IIS/10.0 Yii Framework/1.1.28