Project

General

Profile

Actions

Bug #100872

closed

currentContentObject is not always available

Added by Alexander Stehlik over 1 year ago. Updated 5 months ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Extbase
Target version:
-
Start date:
2023-05-13
Due date:
% Done:

100%

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

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


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 #101170: ContentObjectRenderer instance is not always and not properly added as request attributeClosed2023-06-26

Actions
Actions #1

Updated by Alexander Stehlik over 1 year ago

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

Updated by Benni Mack over 1 year ago

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

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
Actions #4

Updated by Stefan Froemken over 1 year ago

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

Actions #5

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

Actions #6

Updated by Alexander Stehlik over 1 year ago

  • Description updated (diff)
Actions #7

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

Actions #8

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

Actions #9

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

Actions #10

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

Actions #11

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

Actions #12

Updated by Helmut Hummel over 1 year ago

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

Updated by Benni Mack 5 months ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF