Commit 51364d49 authored by Matthias Adrowski's avatar Matthias Adrowski
Browse files

[TASK] Remove Code < TYPO3 10.4

parent bc0d9ab3
......@@ -164,7 +164,7 @@ class ContentReplacerMiddleware implements MiddlewareInterface {
* @throws \TYPO3\CMS\Core\Http\ImmediateResponseException
*/
public function prepareConfiguration(): array {
if (TYPO3_MODE === 'BE') {
if (\TYPO3\CMS\Core\Http\ApplicationType::fromRequest($GLOBALS['TYPO3_REQUEST'])->isBackend()) {
/** @var TypoScriptFrontendController $typoScriptFrontendController */
$typoScriptFrontendController = $GLOBALS['TSFE'];
if (!($typoScriptFrontendController instanceof TypoScriptFrontendController)) {
......@@ -179,21 +179,17 @@ class ContentReplacerMiddleware implements MiddlewareInterface {
}
$extensionConfiguration = $GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['content_replacer'] ?? [];
if (TYPO3_MODE === 'BE') {
if (\TYPO3\CMS\Core\Http\ApplicationType::fromRequest($GLOBALS['TYPO3_REQUEST'])->isBackend()) {
$configurationManager = GeneralUtility::makeInstance(BackendConfigurationManager::class);
$extbaseFrameworkConfiguration = $configurationManager->getTypoScriptSetup();
$typoscriptConfiguration = $extbaseFrameworkConfiguration['plugin.']['tx_content_replacer.'];
} else {
if (empty($GLOBALS['TSFE']->tmpl->setup)) {
// 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;
}
GeneralUtility::makeInstance(Context::class)->setAspect(
'typoscript',
GeneralUtility::makeInstance(TypoScriptAspect::class, 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