Project

General

Profile

Actions

Bug #101170

closed

ContentObjectRenderer instance is not always and not properly added as request attribute

Added by Helmut Hummel 10 months ago. Updated 9 months ago.

Status:
Resolved
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2023-06-26
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
12
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

Prerequisite

Given the following TypoScript:


page = PAGE
page.10 = EXTBASEPLUGIN
page.10 {
  extensionName = MyExt
  pluginName = MyPlugin
}

Given the default action referenced plugin is cached

Expectation

The request in the plugin (and the ConfigurationManager has the currentContentObject attribute set.

Actual behaviour

The currentContentObject is not set

Conceptual considerations

During frontend rendering, all rendering is initiated with an instance of ContentObjectRenderer.
Since most rendering code depends on the current request, the request has always to be passed to
the ContentObjectRenderer, which can then pass it to rendering code it calls.
At the same time some rendering code depends also depends on the data,
that initiated the rendering (aka, the data that is contained in ContentObjectRenderer objects).

I see two options of how to pass the request and the ContentObjectRenderer object (cObj) to the rendering code:

  1. Extend the API to make both accessible directly
  2. Wrap the initiating cObj (the cObj that initiates rendering) into the request it holds as attribute

I suggested the latter in #100623, but what we merged in the end is incomplete and therefore somewhat broken (see above)

I'm still wondering, if we should add the attribute to the request (at least in v12), directly in the request setter in ContentObjectRenderer.


Related issues 3 (0 open3 closed)

Related to TYPO3 Core - Task #100623: Provide current content object as request attributeClosed2023-04-16

Actions
Related to TYPO3 Core - Bug #101201: Clean up ContenObjectRenderer usageResolved2023-06-29

Actions
Related to TYPO3 Core - Bug #100872: currentContentObject is not always availableResolved2023-05-13

Actions
Actions #1

Updated by Helmut Hummel 10 months ago

  • Related to Task #100623: Provide current content object as request attribute added
Actions #2

Updated by Helmut Hummel 10 months ago

  • Description updated (diff)
Actions #3

Updated by Helmut Hummel 10 months ago

  • Description updated (diff)
Actions #4

Updated by Gerrit Code Review 10 months ago

  • Status changed from New to Under Review

Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/79519

Actions #5

Updated by Gerrit Code Review 10 months ago

Patch set 2 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/79519

Actions #6

Updated by Gerrit Code Review 10 months ago

Patch set 1 for branch 12.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/79521

Actions #7

Updated by Helmut Hummel 10 months ago

  • Related to Bug #101201: Clean up ContenObjectRenderer usage added
Actions #8

Updated by Gerrit Code Review 10 months ago

Patch set 3 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/79519

Actions #9

Updated by Gerrit Code Review 10 months ago

Patch set 4 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/79519

Actions #10

Updated by Gerrit Code Review 10 months ago

Patch set 5 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/79519

Actions #11

Updated by Benni Mack 10 months ago

  • Related to Bug #100872: currentContentObject is not always available added
Actions #12

Updated by Gerrit Code Review 10 months ago

Patch set 2 for branch 12.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/79521

Actions #13

Updated by Gerrit Code Review 10 months ago

Patch set 3 for branch 12.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/79521

Actions #14

Updated by Gerrit Code Review 10 months ago

Patch set 6 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/79519

Actions #15

Updated by Gerrit Code Review 9 months ago

Patch set 7 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/79519

Actions #16

Updated by Gerrit Code Review 9 months ago

Patch set 8 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/79519

Actions #17

Updated by Gerrit Code Review 9 months ago

Patch set 4 for branch 12.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/79521

Actions #18

Updated by Gerrit Code Review 9 months ago

Patch set 9 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/79519

Actions #19

Updated by Gerrit Code Review 9 months ago

Patch set 5 for branch 12.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/79521

Actions #20

Updated by Helmut Hummel 9 months ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions

Also available in: Atom PDF