Review 10.4 Merged

72074[BUGFIX] Avoid InvalidTypoScriptConditionException in RedirectHandler

Stefan Bürk CR +2 V +2 Normal +149 −0 updated 11/10/21, 19:23

Commit message

Redirects to target with LinkHandler uri 't3://' need a bootstrapped
'TypoScriptFrontendController' and parsed and executed TypoScript,
which is done later in the middleware stack for normal requests. Thus
RedirectService bootstraps 'TypoScriptFrontedController' to generate
uri for LinkHandler uri.

At this point global '$GLOBAL['TYPO3_REQUEST']' has not been in set,
and the fallback to create it from GLOBALS would not have correct
site and siteLanguage attributes set, which would fail to evaluate
TypoScript conditions correctly like 'fallbackLanguageIds' array
check for siteLanguage attribute, as null is returned instead of
an array.

For v11 this was already fixed through moving to passing the PSR-7
request and initalizing TSFE with passed request in #92666 and the
coresponding patch.

This patch sets a '$GLOBAL['TYPO3_REQUEST'] to the current '$request'
to avoid 'InvalidTypoScriptConditionException' if page is in FE debug
context (ex. DebugPreset). If no redirect is found to be handled, that
temporarly global request object is removed, to handle it through the
normal middleware stack.

Review

  • Code review CR +2

    Imported before Forger kept the single votes, the next import adds them.

  • Verified V +2

    Imported before Forger kept the single votes, the next import adds them.

Issues 2

Files 4