Review main Merged

82416[TASK] Avoid TSFE->contentPid, ->rootLine, ->page, ->id

Christian Kuhn CR +2 V +2 Expert +603 −549 updated 01/12/24, 11:55

Commit message

This removes usages of those properties from TSFE
that have been modeled as PageInformation object
attached to the Request as attribute
'frontend.page.information' with #102715.

The patch is relatively intrusive since especially
TSFE->page and TSFE->id were frequently consumed
properties.

It however allows us to reduce dependencies to TSFE
quite significantly, the number of calls to
$GLOBALS['TSFE'] shrinks.

It also shows that we still have a couple of constructs
that need to get the Request hand over, in particular
the data processors and more importantly the LinkFactory
and link builders: Those tend to either get the Request
using "parent" ContentObjectRenderer->getRequest() (that
method should be declared protected later) or from
$GLOBALS['TYPO3_REQUEST']. We accept this for now since
using $GLOBALS['TYPO3_REQUEST'] is at least less worse
than using $GLOBALS['TSFE']. A dedicated patch will resolve
that situation later, though.

Note most remaining use TSFE->config, especially
TSFE->config['config']. To model this in a good
way, we need a preparation within the TypoScript calculation
in getFromCache(), which will be a target of one of the
next patches.

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 45

Show 25 more files