Commit b647e014 authored by Sascha Egerer's avatar Sascha Egerer Committed by Stefan Neufeind
Browse files

[BUGFIX] Do not override template processors of fluid

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: default avatarTYPO3com <no-reply@typo3.com>
Reviewed-by: Markus Klein's avatarMarkus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein's avatarMarkus Klein <markus.klein@typo3.org>
Reviewed-by: default avatarJoerg Boesche <typo3@joergboesche.de>
Reviewed-by: default avatarStefan Neufeind <typo3.neufeind@speedpartner.de>
Tested-by: default avatarStefan Neufeind <typo3.neufeind@speedpartner.de>
parent 8e101395
......@@ -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)) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment