Skip to content
Snippets Groups Projects
Commit e32c7858 authored by Christian Kuhn's avatar Christian Kuhn
Browse files

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

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.

Resolves: #102824
Related: #102715
Releases: main
Change-Id: I9336b4215155eb53422016254f8ef2edb0ee86cf
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/82416


Reviewed-by: default avatarBenni Mack <benni@typo3.org>
Tested-by: default avatarBenni Mack <benni@typo3.org>
Reviewed-by: default avatarNikita Hovratov <nikita.h@live.de>
Tested-by: default avatarNikita Hovratov <nikita.h@live.de>
Tested-by: default avatarcore-ci <typo3@b13.com>
Tested-by: default avatarStefan Bürk <stefan@buerk.tech>
Reviewed-by: default avatarStefan Bürk <stefan@buerk.tech>
Reviewed-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
parent cdd6cd1b
Showing
with 178 additions and 214 deletions
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment