From 5626f28ba447e54ac88b5c4f575b05e864b72915 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Cybula?= Date: Fri, 12 Feb 2021 15:38:24 +0100 Subject: [PATCH] Fixed template paths whe templating component is not loaded --- DependencyInjection/Compiler/TemplatePathPass.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/DependencyInjection/Compiler/TemplatePathPass.php b/DependencyInjection/Compiler/TemplatePathPass.php index 6332573..166941e 100644 --- a/DependencyInjection/Compiler/TemplatePathPass.php +++ b/DependencyInjection/Compiler/TemplatePathPass.php @@ -20,7 +20,11 @@ final class TemplatePathPass implements CompilerPassInterface { public function process(ContainerBuilder $container) { - $loaderDefinition = $container->getDefinition('twig.loader.filesystem'); + if (true === $container->hasDefinition('twig.loader.native_filesystem')) { + $loaderDefinition = $container->getDefinition('twig.loader.native_filesystem'); + } else { + $loaderDefinition = $container->getDefinition('twig.loader.filesystem'); + } $reflection = new ReflectionClass(DataSourceBundle::class); $loaderDefinition->addMethodCall(