Review main Merged Breaking

82089[!!!][TASK] Avoid TSFE->fe_user

Christian Kuhn CR +2 V +2 Hard +216 −333 updated 12/05/23, 12:47

Commit message

TypoScriptFrontendController->fe_user is the current
FrontendUserAuthentication object. It is set when
constructing the instance.

Since TypoScriptFrontendController is also still set
as $GLOBALS['TSFE'], some extensions tend to fetch
the current FE user from this global state, and
sometimes even inject that into other classes like
repositories. Extension felogin is a victim here: It
models some state of FrontendUserAuthentication in the
service object 'UserService', to then inject this into
repositories and other classes. This indirection is an
anti-pattern.

The current Frontend user is already available either
as Request attribute 'frontend.user', and a limited
list of user details is also available as context
aspect.

The patch removes TSFE->fe_user entirely and dissolves
the offending felogin class. Various other core usages
are adapted as well to avoid fetching this state from
TypoScriptFrontendController.

Review

  • Code review CR +2 Done
    • Christian Kuhn +2
    • Stefan Bürk +1
    • Oliver Hader +1
    • Sascha Nowak +1
    • Benni Mack +1
  • Verified V +2 Done
    • Christian Kuhn +2
    • Stefan Bürk +1
    • Benni Mack +1
    • core-ci +1 CI

Issues 1

Files 25

Show 5 more files

Review log 1418

  1. Christian Kuhn uploaded patch set 1 12/05/23, 09:19

  2. core-ci voted on patch set 1 V +1 12/05/23, 09:25 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/50357

  3. Christian Kuhn uploaded patch set 2 V +1 12/05/23, 09:40

  4. core-ci voted on patch set 2 V +1 12/05/23, 09:46 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/50359

  5. Christian Kuhn uploaded patch set 3 V +1 12/05/23, 11:18

  6. Christian Kuhn rebased onto patch set 4 12/05/23, 11:19

  7. Christian Kuhn uploaded patch set 5 12/05/23, 11:21

  8. core-ci voted on patch set 5 V +1 12/05/23, 11:28 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/50365

  9. Sascha Nowak voted on patch set 5 CR +1 12/05/23, 11:39

  10. Christian Kuhn uploaded patch set 6 CR +1 V +1 12/05/23, 11:41

  11. Sascha Nowak voted on patch set 6 CR +1 12/05/23, 11:46

  12. core-ci voted on patch set 6 V +1 12/05/23, 11:47 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/50367

  13. Benni Mack voted on patch set 6 CR +1 V +1 12/05/23, 11:51

  14. Stefan Bürk voted on patch set 6 CR +1 12/05/23, 12:31

  15. Stefan Bürk voted on patch set 6 V +1 12/05/23, 12:32

  16. Christian Kuhn voted on patch set 6 CR +2 V +2 12/05/23, 12:34

  17. Christian Kuhn merged patch set 7 12/05/23, 12:34

  18. Oliver Hader voted on patch set 7 CR +1 12/05/23, 12:47