Skip to content

Commit

Permalink
Dev: Run theme related things only if a theme is provided
Browse files Browse the repository at this point in the history
  • Loading branch information
olleharstedt committed Jun 6, 2018
1 parent 77dc4a8 commit 0642064
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions application/core/LSETwigViewRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -329,14 +329,17 @@ public function convertTwigToHtml($sString, $aDatas, $oTemplate = null)
// Twig init
$this->_twig = $twig = parent::getTwig();

// Get the additional infos for the view, such as language, direction, etc
$aDatas = $this->getAdditionalInfos($aDatas, $oTemplate);
//Run theme related things only if a theme is provided!
if ($oTemplate !== null) {
// Get the additional infos for the view, such as language, direction, etc
$aDatas = $this->getAdditionalInfos($aDatas, $oTemplate);

// Add to the loader the path of the template and its parents.
$this->addRecursiveTemplatesPath($oTemplate);
// Add to the loader the path of the template and its parents.
$this->addRecursiveTemplatesPath($oTemplate);

// Plugin for blocks replacement
list($sString, $aDatas) = $this->getPluginsData($sString, $aDatas);
// Plugin for blocks replacement
list($sString, $aDatas) = $this->getPluginsData($sString, $aDatas);
}

// Twig rendering
$oTwigTemplate = $twig->createTemplate($sString);
Expand Down

0 comments on commit 0642064

Please sign in to comment.