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 Done
    • Christian Kuhn +2
    • Benni Mack +1
  • Verified V +2 Done
    • Christian Kuhn +2
    • Sybille Peters +1
    • Benni Mack +1
    • core-ci +1 CI

Issues 2

Files 4

Review log 912

  1. Stefan Bürk uploaded patch set 1 11/07/21, 12:55

  2. Stefan Bürk commented on patch set 1 CR -1 11/07/21, 12:56

    Patchset 1 only introduce the test. Core CI must fail, thus -1 would be OK for this patchset. This should be ensure this bug and fix is covered correctly by the test.
  3. core-ci voted on patch set 1 V -1 11/07/21, 13:06 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/18989

  4. Stefan Bürk commented on patch set 1 11/07/21, 13:09

    ^^ failed as expected, and with the correct test which should fail.
  5. Stefan Bürk uploaded patch set 2 11/07/21, 13:17

  6. Stefan Bürk uploaded patch set 3 11/07/21, 13:27

  7. core-ci voted on patch set 2 V -1 11/07/21, 13:28 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/18993

  8. core-ci voted on patch set 3 V +1 11/07/21, 13:38 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/18997

  9. Sybille Peters voted on patch set 3 V +1 11/08/21, 22:12

  10. Benni Mack voted on patch set 3 V +1 CR +1 11/10/21, 11:59

  11. Christian Kuhn voted on patch set 3 V +2 CR +2 11/10/21, 19:23

  12. Christian Kuhn merged patch set 4 11/10/21, 19:23