Skip to content

Commit

Permalink
Fixed issue #14941: Variations choosed in Global theme options are no…
Browse files Browse the repository at this point in the history
…t set in preview
  • Loading branch information
dominikvitt committed May 29, 2019
1 parent 8820d96 commit 7ea69d5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions application/controllers/admin/themes.php
Expand Up @@ -916,7 +916,7 @@ protected function _templatesummary($templatename, $screenname, $editfile, $rela
protected function _initialise($templatename, $screenname, $editfile, $showsummary = true)
{
// LimeSurvey style
$oEditedTemplate = Template::getInstance($templatename, null, null, true);
$oEditedTemplate = Template::getInstance($templatename, null, null, true, true)->prepareTemplateRendering($templatename, null, true);

//App()->getClientScript()->reset();
Yii::app()->loadHelper('surveytranslator');
Expand Down Expand Up @@ -1250,6 +1250,8 @@ protected function _initialise($templatename, $screenname, $editfile, $showsumma

$thissurvey['include_content'] = $sContentFile;

// new TemplateConfiguration model created so preview can read theme options from DB
$oTemplateForPreview = Template::getInstance($templatename, null, null, false)->prepareTemplateRendering($templatename, null, true);

try {
$myoutput = Yii::app()->twigRenderer->renderTemplateForTemplateEditor(
Expand All @@ -1258,7 +1260,7 @@ protected function _initialise($templatename, $screenname, $editfile, $showsumma
'aSurveyInfo' =>$thissurvey,
'print' => $print // Only used for PDF print layout.
),
$oEditedTemplate
$oTemplateForPreview
);
} catch (Exception $ex) {
$myoutput = "<h3>ERROR!</h3>";
Expand Down

0 comments on commit 7ea69d5

Please sign in to comment.