Project

General

Profile

Actions

Bug #101170

closed

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

Added by Helmut Hummel over 1 year ago. Updated 5 months ago.

Status:
Closed
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 usageClosed2023-06-29

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

Actions
Actions

Also available in: Atom PDF