Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix a bug that caused some globals to be skipped
If the globals were defined by an extension, there was a scenario that caused them to be skipped. Maybe this isn't the right place to fix it, but it does work in my local testing.
  • Loading branch information
beryllium committed Mar 7, 2020
1 parent 81b5c64 commit 0e32a1b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Sculpin/Bundle/TwigBundle/TwigFormatter.php
Expand Up @@ -55,6 +55,10 @@ public function formatBlocks(FormatContext $formatContext): array
$this->massageTemplate($formatContext)
);
$data = $formatContext->data()->export();

// apply twig globals to the context array prior to loading the template
$data = $this->twig->mergeGlobals($data);

$template = $this->twig->loadTemplate($formatContext->templateId());

if (!count($blockNames = $this->findAllBlocks($template, $data))) {
Expand Down

0 comments on commit 0e32a1b

Please sign in to comment.