Skip to content
Snippets Groups Projects
Commit b193d256 authored by Helmut Hummel's avatar Helmut Hummel Committed by Christian Kuhn
Browse files

[TASK] Provide current content object as request attribute

Extbase ConfigurationManager as stateful singleton
object is updated within extbase bootstrap for
each plugin call. This is ugly, but since
ConfigurationManager can be injected to other
extbase services, which can be injected itself,
it is very hard to get rid of.

However, ConfigurationManager is also abused to
"park" the current ContentObjectRenderer instance
in this "convenient" singleton. The current
content object renderer instance can then be retrieved
at extbase runtime using getContentObject().

The form extension uses this at a couple of places
to move the ContentObjectRenderer data around. The
ConfigurationManager should however not be a source
of such data, and our main "state" object in the
framework is the request (which ConfigurationManager
needs as well, but that's a different patch).

To allow a deprecation of getContentObject() in
ConfigurationManager, the patch changes the codebase
to attach the current content object as request attribute
instead. This is a bit fiddly as well since
ContentObjectRenderer can be recursive (cObj rendering other
cObj again), but the change at least makes this state more
obvious, and we're pretty confident the situation will
further relax and become more transparent with continued
ContentObjectRenderer refactorings. Some of these
have been prepared in v12 already and we'll see
more on this with v13.

The patch does the main refactoring, deprecating
getContentObject() will follow with another patch.
The patch does not add the attribute at all places
where ContentObjectRenderer instances are created,
more may follow later. The main goal of this patch
is to create the main infrastructure and to not break
the form extension.

Resolves: #100623
Releases: main
Change-Id: I3de7f53244c0b438ef54940d87a169068f1a832e
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/77252


Tested-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: default avatarBenni Mack <benni@typo3.org>
Tested-by: default avatarStefan Bürk <stefan@buerk.tech>
Reviewed-by: default avatarStefan Bürk <stefan@buerk.tech>
Reviewed-by: default avatarBenni Mack <benni@typo3.org>
Tested-by: default avatarcore-ci <typo3@b13.com>
parent cc8faadf
Branches
Tags
No related merge requests found
Showing
with 101 additions and 90 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