Bug #101170
closedContentObjectRenderer instance is not always and not properly added as request attribute
100%
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:
- Extend the API to make both accessible directly
- 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.