PHP notice

Trying to get property 'folder' of non-object

/mnt/data/shnoulle/nginx/www/master/application/models/Template.php(297)

285     public static function getTemplatePath($sTemplateName = "")
286     {
287         static $aTemplatePath = array();
288         if (isset($aTemplatePath[$sTemplateName])) {
289             return $aTemplatePath[$sTemplateName];
290         }
291 
292         $oTemplate = self::model()->findByPk($sTemplateName);
293 
294         if (self::isStandardTemplate($sTemplateName)) {
295             return $aTemplatePath[$sTemplateName] = Yii::app()->getConfig("standardthemerootdir").DIRECTORY_SEPARATOR.$oTemplate->folder;
296         } else {
297             return $aTemplatePath[$sTemplateName] = Yii::app()->getConfig("userthemerootdir").DIRECTORY_SEPARATOR.$oTemplate->folder;
298         }
299     }
300 
301     /**
302      * This method construct a template object, having all the needed configuration datas.
303      * It checks if the required template is a core one or a user one.
304      * If it's a user template, it will check if it's an old 2.0x template to provide default configuration values corresponding to the old template system
305      * If it's not an old template, it will check if it has a configuration file to load its datas.
306      * If it's not the case (template probably doesn't exist), it will load the default template configuration
307      * TODO : more tests should be done, with a call to private function _is_valid_template(), testing not only if it has a config.xml, but also id this file is correct, if the files refered in css exist, etc.
308      *
309      * @param string $sTemplateName     the name of the template to load. The string come from the template selector in survey settings

Stack Trace

#0
+
 /mnt/data/shnoulle/nginx/www/master/application/controllers/admin/export.php(1271): Template::getTemplatePath("inherit")
1266      */
1267     private function _exportPrintableHtmls($iSurveyID, $readFile = true)
1268     {
1269         $oSurvey = Survey::model()->findByPk($iSurveyID);
1270         $assetsDir = substr(Template::getTemplateURL($oSurvey->template), 1);
1271         $fullAssetsDir = Template::getTemplatePath($oSurvey->template);
1272         $aLanguages = $oSurvey->getAllLanguages();
1273 
1274         Yii::import('application.helpers.common_helper', true);
1275         $zipdir = createRandomTempDir();
1276 
#1
+
 /mnt/data/shnoulle/nginx/www/master/application/controllers/admin/export.php(1094): export->_exportPrintableHtmls("484668")
1089         } elseif ($action == 'exportstructuretsv') {
1090             $this->_exporttsv($iSurveyID);
1091         } elseif ($action == "exportarchive") {
1092             $this->_exportarchive($iSurveyID);
1093         } elseif ($action == "exportprintables") {
1094             $this->_exportPrintableHtmls($iSurveyID);
1095         }
1096     }
1097 
1098     /**
1099      * Return a list of queXML settings
#2
+
 /mnt/data/shnoulle/nginx/www/master/application/controllers/admin/export.php(42): export->_surveyexport("exportprintables", "484668")
37     {
38         $action = Yii::app()->request->getParam('action');
39         $iSurveyID = sanitize_int(Yii::app()->request->getParam('surveyid'));
40 
41         if (Permission::model()->hasSurveyPermission($iSurveyID, 'surveycontent', 'export')) {
42             $this->_surveyexport($action, $iSurveyID);
43             return;
44         }
45     }
46 
47     /**
2020-03-03 07:00:06 nginx/1.16.1 Yii Framework/1.1.22-dev