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

    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 1

Files 25

Show 5 more files