diff --git a/application/models/TemplateConfiguration.php b/application/models/TemplateConfiguration.php index 54b47ad0f26..37f8bd475cb 100644 --- a/application/models/TemplateConfiguration.php +++ b/application/models/TemplateConfiguration.php @@ -86,6 +86,18 @@ public function setTemplateConfiguration($sTemplateName='', $iSurveyId='') } + // If the template directory doesn't exist, it can be that: + // - user deleted a custom theme + // In any case, we just set Default as the template to use + if (!is_dir($this->path)) + { + $this->sTemplateName = 'default'; + $this->isStandard = true; + $this->path = Yii::app()->getConfig("standardtemplaterootdir").DIRECTORY_SEPARATOR.$this->sTemplateName; + setGlobalSetting('defaulttemplate', 'Sea_Green'); + } + + // If the template don't have a config file (maybe it has been deleted, or whatever), // then, we load the default template $this->hasConfigFile = is_file($this->path.DIRECTORY_SEPARATOR.'config.xml');