[BUGFIX] Do not override template processors of fluid 90/50590/4
authorSascha Egerer <sascha@sascha-egerer.de>
Fri, 11 Nov 2016 08:25:40 +0000 (09:25 +0100)
committerStefan Neufeind <typo3.neufeind@speedpartner.de>
Wed, 16 Nov 2016 21:42:01 +0000 (22:42 +0100)
Fluid defines it's own template processors that are currently overridden
in the TYPO3 Fluid rendering context.
This becomes important if fluid standalone adds template processors or adjusts
it's RenderingContext constructor like in
https://github.com/TYPO3/Fluid/pull/220

Change-Id: I69b044e308421665ea8c88be7789da1a4323828f
Resolves: #78651
Releases: master
Reviewed-on: https://review.typo3.org/50590
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
Reviewed-by: Joerg Boesche <typo3@joergboesche.de>
Reviewed-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
Tested-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
typo3/sysext/fluid/Classes/Core/Rendering/RenderingContext.php

index bec6245..7b0554b 100644 (file)
@@ -24,13 +24,10 @@ use TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\Expression\LegacyNamespaceExpressionN
 use TYPO3\CMS\Fluid\Core\Variables\CmsVariableProvider;
 use TYPO3\CMS\Fluid\Core\ViewHelper\ViewHelperResolver;
 use TYPO3\CMS\Fluid\View\TemplatePaths;
-use TYPO3Fluid\Fluid\Core\Compiler\TemplateCompiler;
 use TYPO3Fluid\Fluid\Core\Parser\Configuration;
 use TYPO3Fluid\Fluid\Core\Parser\SyntaxTree\Expression\CastingExpressionNode;
 use TYPO3Fluid\Fluid\Core\Parser\SyntaxTree\Expression\MathExpressionNode;
 use TYPO3Fluid\Fluid\Core\Parser\SyntaxTree\Expression\TernaryExpressionNode;
-use TYPO3Fluid\Fluid\Core\Parser\TemplateParser;
-use TYPO3Fluid\Fluid\Core\ViewHelper\ViewHelperInvoker;
 use TYPO3Fluid\Fluid\Core\ViewHelper\ViewHelperVariableContainer;
 use TYPO3Fluid\Fluid\View\ViewInterface;
 
@@ -120,20 +117,23 @@ class RenderingContext extends \TYPO3Fluid\Fluid\Core\Rendering\RenderingContext
      */
     public function __construct(ViewInterface $view = null)
     {
+        parent::__construct($view);
+
         $objectManager = GeneralUtility::makeInstance(ObjectManager::class);
         if ($view) {
             $this->view = $view;
         }
-        $this->setTemplateParser(new TemplateParser());
-        $this->setTemplateCompiler(new TemplateCompiler());
-        $this->setViewHelperInvoker(new ViewHelperInvoker());
-        $this->setViewHelperVariableContainer(new ViewHelperVariableContainer());
         $this->setTemplatePaths($objectManager->get(TemplatePaths::class));
         $this->setViewHelperResolver($objectManager->get(ViewHelperResolver::class));
         $this->setVariableProvider($objectManager->get(CmsVariableProvider::class));
-        $this->setTemplateProcessors([
-            $objectManager->get(XmlnsNamespaceTemplatePreProcessor::class),
-        ]);
+        $this->setTemplateProcessors(
+            array_merge(
+                parent::getTemplateProcessors(),
+                [
+                    $objectManager->get(XmlnsNamespaceTemplatePreProcessor::class),
+                ]
+            )
+        );
         /** @var FluidTemplateCache $cache */
         $cache = $objectManager->get(CacheManager::class)->getCache('fluid_template');
         if (is_a($GLOBALS['TYPO3_CONF_VARS']['SYS']['caching']['cacheConfigurations']['fluid_template']['frontend'], FluidTemplateCache::class, true)) {