Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[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: Benni Mack <[email protected]> Tested-by: core-ci <[email protected]> Reviewed-by: Christian Kuhn <[email protected]> Tested-by: Benni Mack <[email protected]> Tested-by: Christian Kuhn <[email protected]>
- Loading branch information