diff --git a/src/Symfony/Bridge/Twig/Form/TwigRendererEngine.php b/src/Symfony/Bridge/Twig/Form/TwigRendererEngine.php index b17da340989e1..e94dd2e4bb403 100644 --- a/src/Symfony/Bridge/Twig/Form/TwigRendererEngine.php +++ b/src/Symfony/Bridge/Twig/Form/TwigRendererEngine.php @@ -44,7 +44,7 @@ public function renderBlock(FormView $view, $resource, string $blockName, array { $cacheKey = $view->vars[self::CACHE_KEY_VAR]; - $context = $this->environment->mergeGlobals($variables); + $context = $variables + $this->environment->getGlobals(); ob_start(); @@ -164,7 +164,7 @@ protected function loadResourcesFromTheme(string $cacheKey, &$theme) // theme is a reference and we don't want to change it. $currentTheme = $theme; - $context = $this->environment->mergeGlobals([]); + $context = $this->environment->getGlobals(); // The do loop takes care of template inheritance. // Add blocks from all templates in the inheritance tree, but avoid