Skip to content

Commit

Permalink
[TASK] Force template parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
flossels committed Jun 24, 2021
1 parent 018a982 commit c114ab2
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Classes/Middleware/LanguageRedirectMiddleware.php
Expand Up @@ -19,6 +19,8 @@
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Server\MiddlewareInterface;
use Psr\Http\Server\RequestHandlerInterface;
use TYPO3\CMS\Core\Context\Context;
use TYPO3\CMS\Core\Context\TypoScriptAspect;
use TYPO3\CMS\Core\TypoScript\TemplateService;
use TYPO3\CMS\Core\Utility\GeneralUtility;

Expand Down Expand Up @@ -53,6 +55,12 @@ public function process(ServerRequestInterface $request, RequestHandlerInterface
protected function getTypoScriptSetup(): array
{
if (!$GLOBALS['TSFE']->tmpl instanceof TemplateService || empty($GLOBALS['TSFE']->tmpl->setup)) {
$context = GeneralUtility::makeInstance(Context::class);

if ($context->getPropertyFromAspect('typoscript', 'forcedTemplateParsing') === false) {
$context->setAspect('typoscript', new TypoScriptAspect(true));
}

$GLOBALS['TSFE']->getConfigArray();
}

Expand Down

0 comments on commit c114ab2

Please sign in to comment.