Commit c5df5048 authored by Tim Wagner's avatar Tim Wagner
Browse files

[BUGFIX] TypoScriptAspect does not exist yet in TYPO3 9

parent ed5ba8e5
......@@ -39,6 +39,7 @@ use TYPO3\CMS\Core\Context\TypoScriptAspect;
use TYPO3\CMS\Core\Http\Stream;
use TYPO3\CMS\Core\Http\StreamFactory;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Core\Utility\VersionNumberUtility;
use TYPO3\CMS\Extbase\Configuration\BackendConfigurationManager;
use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController;
......@@ -195,8 +196,15 @@ class ContentReplacerMiddleware implements MiddlewareInterface {
$typoscriptConfiguration = $extbaseFrameworkConfiguration['plugin.']['tx_content_replacer.'];
} else {
if (empty($GLOBALS['TSFE']->tmpl->setup)) {
// we need the TypoScript configuration here, force paring
GeneralUtility::makeInstance(Context::class)->setAspect('typoscript', GeneralUtility::makeInstance(TypoScriptAspect::class, true));
// we need the TypoScript configuration here, force parsing
if (version_compare(VersionNumberUtility::getCurrentTypo3Version(), '10.4.0', '>=')) {
GeneralUtility::makeInstance(Context::class)->setAspect(
'typoscript',
GeneralUtility::makeInstance(TypoScriptAspect::class, TRUE)
);
} else {
$GLOBALS['TSFE']->forceTemplateParsing = TRUE;
}
$GLOBALS['TSFE']->tmpl->start($GLOBALS['TSFE']->rootLine);
}
......
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