Bug #100872
closedcurrentContentObject is not always available
100%
Description
When using the EXTBASEPLUGIN
content element outside the lib.contentElement
context the request attribute currentContentObject
is not filled correctly.
The problem only occurs when the content is rendered with the f:cObject view helper in a FLUIDTEMPLATE content object. This is a minimal page setup with fluid_styled_content TypoScript included:
lib.content.main < styles.content.get page = PAGE page.100 = FLUIDTEMPLATE page.100.template = TEXT page.100.template.value = <p>The form</p><f:cObject typoscriptObjectPath="lib.content.main"/>
It can be tested by changing the config of the form_formframework
content element:
This works (the default config):
tt_content.form_formframework =< lib.contentElement tt_content.form_formframework { 20 = EXTBASEPLUGIN 20 { extensionName = Form pluginName = Formframework } templateName = Generic }
When rendering the plugin directly, the currentContentObject
is null
:
tt_content.form_formframework > tt_content.form_formframework = EXTBASEPLUGIN tt_content.form_formframework { extensionName = Form pluginName = Formframework }
And maybe this is related: I just realized that the settings-Array is also empty in the second example.
Files
Updated by Alexander Stehlik over 1 year ago
- Related to Task #100623: Provide current content object as request attribute added
Updated by Benni Mack over 1 year ago
- Related to Bug #101201: Clean up ContenObjectRenderer usage added
Updated by Benni Mack over 1 year ago
- Related to Bug #101170: ContentObjectRenderer instance is not always and not properly added as request attribute added
Updated by Stefan Froemken over 1 year ago
- File Bildschirmfoto 2023-07-10 um 19.12.46.png Bildschirmfoto 2023-07-10 um 19.12.46.png added
- Status changed from New to Needs Feedback
Hello Alexander,
I have adopted your modifications on my TYPO3 12 instance and can't reproduce that issue. Please have a look into my xDebug session image. There is a ContentObjectRenderer in $this->cObj AND also available in TSFE->getContentObjectRenderer().
Please provide any further information on how to reproduce tht issue.
Stefan
Updated by Alexander Stehlik over 1 year ago
- Description updated (diff)
Hi @Stefan Froemken,
thank you for looking into this.
I realized for the problem to occur a FLUIDTEMPLATE
also needs to be used to render the content. This is a full TypoScript example where the form is not rendered any more because the settings array does not contain the configured persistenceIdentifier
:
lib.content.main < styles.content.get page = PAGE page.100 = FLUIDTEMPLATE page.100.template = TEXT page.100.template.value = <p>The form</p><f:cObject typoscriptObjectPath="lib.content.main"/> tt_content.form_formframework > tt_content.form_formframework = EXTBASEPLUGIN tt_content.form_formframework { extensionName = Form pluginName = Formframework }
I also realized that the currentContentObject
-Attribute returns a ContentObjectRenderer
instance but its data
property is null.
I hope this helps.
Cheers
Alex
Updated by Gerrit Code Review over 1 year ago
- Status changed from Needs Feedback to Under Review
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
Updated by Gerrit Code Review over 1 year 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
Updated by Gerrit Code Review over 1 year 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
Updated by Gerrit Code Review over 1 year 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
Updated by Gerrit Code Review over 1 year 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
Updated by Helmut Hummel over 1 year ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 3c9ad409dd55fe8ff6a003f927b7399e992d1ee4.