Skip to content

Commit

Permalink
Merge pull request #425 from Shnoulle/master_10266
Browse files Browse the repository at this point in the history
Fixed issue #10266: After update to 2.5 with updated default template
  • Loading branch information
c-schmitz committed Feb 2, 2016
2 parents 530abc1 + 5eabd85 commit b9260c8
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions application/models/Template.php
Expand Up @@ -144,17 +144,24 @@ public static function getTemplateConfiguration($sTemplateName='', $iSurveyId=''

$oTemplate = new stdClass();
$oTemplate->isStandard = self::isStandardTemplate($sTemplateName);

// If the template doesn't exist, set to Default
if($oTemplate->isStandard)
{
$oTemplate->name = (is_dir(Yii::app()->getConfig("standardtemplaterootdir").DIRECTORY_SEPARATOR.$sTemplateName))?$sTemplateName:'Default';
$oTemplate->name = $sTemplateName;
$oTemplate->path = Yii::app()->getConfig("standardtemplaterootdir").DIRECTORY_SEPARATOR.$oTemplate->name;
}
else
{
$oTemplate->name = (is_dir(Yii::app()->getConfig("usertemplaterootdir").DIRECTORY_SEPARATOR.$sTemplateName))?$sTemplateName:'Default';
$oTemplate->path = Yii::app()->getConfig("usertemplaterootdir").DIRECTORY_SEPARATOR.$oTemplate->name;
if(is_file(Yii::app()->getConfig("usertemplaterootdir").DIRECTORY_SEPARATOR.$sTemplateName).DIRECTORY_SEPARATOR.'config.xml')
{
$oTemplate->name = $sTemplateName;
$oTemplate->path = Yii::app()->getConfig("usertemplaterootdir").DIRECTORY_SEPARATOR.$oTemplate->name;
}
else
{
$oTemplate->name = 'default';
$oTemplate->path = Yii::app()->getConfig("standardtemplaterootdir").DIRECTORY_SEPARATOR.$oTemplate->name;
}
}

// The template configuration.
Expand Down

0 comments on commit b9260c8

Please sign in to comment.