diff --git a/phpBB/phpbb/template/twig/environment.php b/phpBB/phpbb/template/twig/environment.php index 65f1af5d9e..56c85c8d71 100644 --- a/phpBB/phpbb/template/twig/environment.php +++ b/phpBB/phpbb/template/twig/environment.php @@ -213,8 +213,11 @@ class environment extends \Twig_Environment { $placeholder_salt = unique_id(); - $context['definition']->set('SCRIPTS', '__SCRIPTS_' . $placeholder_salt . '__'); - $context['definition']->set('STYLESHEETS', '__STYLESHEETS_' . $placeholder_salt . '__'); + if (array_key_exists('definition', $context)) + { + $context['definition']->set('SCRIPTS', '__SCRIPTS_' . $placeholder_salt . '__'); + $context['definition']->set('STYLESHEETS', '__STYLESHEETS_' . $placeholder_salt . '__'); + } $output = parent::render($name, $context);