Review main Merged Breaking

64592[!!!][TASK] Remove deprecated constructor arguments in TSFE

Benni Mack CR +2 V +2 Hard +78 −190 updated 05/29/20, 15:27

Commit message

Since TYPO3 v10 the god-object TSFE is now built with
everything that is mandatory for rendering the Frontend:
* Context
* Site
* SiteLanguage
* PageArguments
* FrontendUser

The ultimate goal is to make TSFE be built without any global logic
in the future, so it can be re-used and simulated in the backend as well,
if needed. Also, the goal is to reduce the access to the global object,
relying on other factors instead.

Review

  • Code review CR +2 Done
    • Anja Leichsenring +2
    • Benjamin Franzke +1
    • Benni Mack +1
  • Verified V +2 Done
    • Anja Leichsenring +2
    • Benjamin Franzke +1
    • Benni Mack +1
    • TYPO3com +1 CI

Issues 2

Files 12

Review log 1522

  1. Benni Mack uploaded patch set 1 05/28/20, 08:49

  2. TYPO3com voted on patch set 1 V +1 05/28/20, 09:13 Completed build in 24m 06s on Thu, 28 May, 09:13 AM Test Summary: 73709 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-3605

  3. Benjamin Franzke commented on patch set 1 05/29/20, 07:43

    TypoScriptFrontendController.php:709

    The fallback to GeneralUtility::makeInstance(FrontendUserAuthentication::class); seems to be new functionality. Can you elaborate on that one? Does that go in line with the upcoming removal of initFEUser, which means fe_user can not be set later and needs to be initialized at construction time? With that change the type docblock for $this->fe_user could be adapted as it still allows the type `string`. I would somehow prefer to not make the constructor argument nullable and have the initialization middleware to create the FrontendUserAuthentication instance if none is available in the PSR-7 attribute. I guess that would be considered a breaking change?
  4. Benni Mack commented on patch set 1 05/29/20, 08:07

    TypoScriptFrontendController.php:709 Reply

    Good catch. Let's make it non-nullable then, the PSR-15 middleware is actually doing it right. This is a breaking change, so we can do that in the same patch IMHO.
  5. Benjamin Franzke commented on patch set 1 05/29/20, 08:13

    TypoScriptFrontendController.php:709 Reply Unresolved

    Sorry, forget my statement about initFEuser() – I was looking into an incorrect folder locally. FrontendUserAuthentication is currently always added by the initialization middleware, therefore we do not trigger the nullable case in regular frontend processing. But it would be triggered by the RedirectService, which passes null and sets `fe_user = ` afterwards. Will upload a change to fix that in this patch. Therefore I'd opt to one of these options: * do not create a (possibly redundant) FrontendUserAuthentication instance but leave fe_user as null if it has not been passed (behaviour as it was before) * Mark the constructor parameter required in order for "initializers" of this class to think about which FrontendUserAuthentication object needs to be passed
  6. Benjamin Franzke uploaded patch set 2 05/29/20, 08:41

  7. TYPO3com voted on patch set 2 V -1 05/29/20, 08:57 Completed build in 15m 23s on Fri, 29 May, 08:57 AM Test Summary: 187 of 74205 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-3616

  8. Benjamin Franzke uploaded patch set 3 05/29/20, 09:27

  9. TYPO3com voted on patch set 3 V -1 05/29/20, 09:41 Completed build in 14m 25s on Fri, 29 May, 09:41 AM Test Summary: 3 of 74206 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-3618

  10. Andreas Kienast rebased onto patch set 4 05/29/20, 10:24

  11. TYPO3com voted on patch set 4 V +1 05/29/20, 10:40 Completed build in 15m 38s on Fri, 29 May, 10:40 AM Test Summary: 73718 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-3622

  12. Benni Mack uploaded patch set 5 05/29/20, 11:12

  13. Benjamin Franzke uploaded patch set 6 1 comment 05/29/20, 11:29

  14. Benjamin Franzke uploaded patch set 7 05/29/20, 11:57

  15. TYPO3com voted on patch set 5 V +1 05/29/20, 12:13 Completed build in 1h 01m 07s on Fri, 29 May, 12:13 PM Test Summary: 73073 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-3626

  16. TYPO3com voted on patch set 6 V +1 05/29/20, 12:28 Completed build in 59m 36s on Fri, 29 May, 12:28 PM Test Summary: 73073 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-3628

  17. Benni Mack voted on patch set 7 V +1 CR +1 05/29/20, 12:29

  18. TYPO3com voted on patch set 7 V +1 05/29/20, 12:36 Completed build in 17m 21s on Fri, 29 May, 12:36 PM Test Summary: 73073 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-3629

  19. Benjamin Franzke commented on patch set 7 CR +1 05/29/20, 12:55

    CObjectViewHelper.php:219

    TypoScriptFrontendController::getGlobalInstance() may throw a LogicException in frontend, therefore we need to stick with $GLOBALS['TSFE'] to test the availability.
  20. Benjamin Franzke voted on patch set 7 V +1 05/29/20, 13:28

  21. Anja Leichsenring voted on patch set 7 V +2 CR +2 05/29/20, 15:27

  22. Anja Leichsenring merged patch set 8 05/29/20, 15:27