Skip to content

Commit

Permalink
Merge pull request #4 from m-vo/bugfix/restore-legacy-context
Browse files Browse the repository at this point in the history
Bugfix/restore old template context
  • Loading branch information
m-vo authored Mar 23, 2020
2 parents 29313d0 + 9d193b5 commit 3852c63
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/EventListener/RenderingForwarder.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@ public function render(Template $contaoTemplate): string
$template = $data[self::TWIG_TEMPLATE] ?? null;
$context = $data[self::TEMPLATE_CONTEXT] ?? null;

// restore old template context, so that legacy modules are happy
// (e.g. ModuleNavigation is checking for Template->items)
$contaoTemplate->setData($context);

if (null === $template) {
throw new \InvalidArgumentException("The template's context must contain a value for '".self::TWIG_TEMPLATE."'");
}
Expand Down

0 comments on commit 3852c63

Please sign in to comment.