Review 12.4 Merged

79521[BUGFIX] Avoid circular reference of COR and ServerRequest

Helmut Hummel CR +2 V +2 Normal +37 −32 updated 08/02/23, 14:31

Commit message

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.

Review

  • Code review CR +2 Done
    • Benni Mack +2
    • Christian Kuhn +1
  • Verified V +2 Done
    • Benni Mack +2
    • Christian Kuhn +1
    • core-ci +1 CI

Issues 3

Files 10

Review log 1217

  1. Helmut Hummel uploaded patch set 1 06/27/23, 12:24

  2. Helmut Hummel wrote 06/27/23, 12:24

    Set private
  3. Helmut Hummel wrote 06/27/23, 12:24

    Unset private
  4. Helmut Hummel marked it work in progress 06/27/23, 12:24

  5. core-ci voted on patch set 1 V +1 06/27/23, 12:31 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/43028

  6. Helmut Hummel uploaded patch set 2 V +1 07/06/23, 12:40

  7. Helmut Hummel uploaded patch set 3 07/06/23, 12:42

  8. core-ci voted on patch set 3 V +1 07/06/23, 13:00 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/43731

  9. core-ci voted on patch set 2 V +1 07/06/23, 13:01 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/43730

  10. Helmut Hummel marked it ready for review 07/31/23, 17:07

  11. Christian Kuhn uploaded patch set 4 V +1 08/02/23, 11:03

  12. core-ci voted on patch set 4 V +1 08/02/23, 11:11 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/44876

  13. Oliver Klee updated the commit message in patch set 5 V +1 08/02/23, 11:32

  14. core-ci voted on patch set 5 V +1 08/02/23, 11:44 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/44879

  15. Christian Kuhn voted on patch set 5 V +1 CR +1 08/02/23, 12:07

  16. Benni Mack voted on patch set 5 V +2 CR +2 08/02/23, 14:31

  17. Benni Mack merged patch set 6 08/02/23, 14:31