Leuchtfeuer/locate

TSFE->tmpl should be parsed when empty

jurajsulek opened this issue · 0 comments

in the file:
typo3conf/ext/locate/Classes/Middleware/LanguageRedirectMiddleware.php

the line: $typoScript = $GLOBALS['TSFE']->tmpl->setup;
works only when the page is not cached. After the Page get chached, the $GLOBALS['TSFE']->tmpl->setup will return an empty array()

you should change it to:
if ($GLOBALS['TSFE']->tmpl === null || ($GLOBALS['TSFE']->tmpl && empty($GLOBALS['TSFE']->tmpl->setup))) {
$GLOBALS['TSFE']->forceTemplateParsing = true;
$GLOBALS['TSFE']->getConfigArray();
}
$typoScript = $GLOBALS['TSFE']->tmpl->setup;

in order to generate the typoscript array