Leuchtfeuer / locate

The users country and preferred language and other facts will be detected. Depending on configurable rules the user can be redirected to other languages or pages. New functionality can be added easily.
https://www.Leuchtfeuer.com
GNU General Public License v2.0
9 stars 14 forks source link

TSFE->tmpl should be parsed when empty #21

Closed jurajsulek closed 3 years ago

jurajsulek commented 3 years ago

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