Skip to content
Snippets Groups Projects
Commit 3c9ad409 authored by Helmut Hummel's avatar Helmut Hummel Committed by Benni Mack
Browse files

[BUGFIX] Avoid circular reference of COR and ServerRequest

While the initial idea to store the current ContentObjectRender
(cObj) instance in a request attribute, to pass it along to code
that requires both, the request and a cObj, is solid, we missed
that cObj itself does not require to hold the request as attribute.

The patch changes this: The request attribute is only set
for ContentObjects, as these are actually responsible for
rendering and eventually evaluating a request or the cObj
instance.

This makes sure, that an instance of cObj is available for
Extbase plugins as well as for Fluid view helpers, which can
access the request via RenderingContext.

By changing the concept slightly, all places that previously added
the cObj to the request can be removed in favor of doing so only
in AbstractContentObject and ContentObjectRenderer::callUserFunction.
The latter is at least required for TypoScript using the old way of
calling Extbase plugins with USER and it's userFunc property.

The circular reference is now removed, by not passing the request
that contains the cObj attribute to the cObj itself. This means:

* When a cObj is available, one can obtain the request using its getter
* Such request objects, do NOT contain an attribute containing the cObj
* The cObj request attribute can now be obtained in all content objects
  (such as EXTBASEPLUGIN or FLUIDTEMPLATE) and user functions, that are
  called from be ContentObjectRenderer.

Releases: main, 12.4
Resolves: #101170
Resolves: #100872
Related: #100623
Change-Id: I6acb1a92c8b02f1be2f3a396fe9d9465d6482033
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/79519


Reviewed-by: default avatarBenni Mack <benni@typo3.org>
Tested-by: default avatarcore-ci <typo3@b13.com>
Reviewed-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: default avatarBenni Mack <benni@typo3.org>
Tested-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
parent 2b7a544e
No related branches found
No related tags found
No related merge requests found
Showing with 36 additions and 31 deletions
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment