Bug #76489

f:cObject resets other global parameters in fluid_styled_content

Added by Stephan Bauer over 4 years ago. Updated 9 months ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Fluid
Target version:
-
Start date:
2016-06-07
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
7
PHP Version:
7.0
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

I'm using f:cObject in a fluidcontent element (https://typo3.org/extensions/repository/view/fluidcontent/) like this:
<f:cObject data="{record}" typoscriptObjectPath="lib.stdheader" />
Using a viewhelper like this {v:content.resources.fal(field: 'bild')} after 'f:cObject' does not work because it is set to 'NULL'.
It works using css_styled_content.


Related issues

Follows TYPO3 Core - Story #73183: Removal of frontend simulation in all ViewHelpersClosed2016-02-08

Actions
#1

Updated by Claus Due over 4 years ago

What appears to be happening:

  • ContentObjectRenderer is instantiated without constructor TypoScriptFrontendController argument
  • getTypoScriptFrontendController on same class then returns $_GLOBALS['TSFE']
  • State of $GLOBALS['TSFE'] appears to become mutated
  • State is not reset when ending content rendering

I believe the problem is the recursiveness: when TypoScriptFrontendController renders any content element it mutates it's own state with various stack depth counters etc., thus rendering another content element inside that content element causes issues with that mutated TSFE state. Code that executes after a second "content object" (it isn't actually an editor-inserted content object but gets rendered as if it were!) is rendered then either has a cleaned state or incorrectly sees properties of the secondary "content object" that was rendered. I didn't check which it is.

Possible solutions:

1. Pass a clone of TSFE as constructor argument for `ContentObjectRenderer`
2. Use a freshly created TypoScriptFrontendController (avoid ContentObjectRenderer, do not reuse TSFE global)

I would suggest either one as valid. Another benefit would become able to pass a simulated TSFE instance to this method. See #73183 for some further perspectives about the benefits of that ability.

#2

Updated by Claus Due over 4 years ago

Set to follow #73183 since merging that one would provide a neat API to get a simulated ContentObjectRenderer ideal for use in ``f:cObject``.

#3

Updated by Gerrit Code Review about 2 years ago

  • Status changed from New to Under Review

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

#4

Updated by Gerrit Code Review about 2 years ago

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

#5

Updated by Gerrit Code Review about 2 years ago

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

#6

Updated by Georg Ringer about 2 years ago

  • Has duplicate Bug #87003: Plugins overrides Page Data added
#7

Updated by Josef Glatz about 2 years ago

  • Related to Bug #86979: stdWrap fieldRequired/insertData sometimes not working as expected since TYPO3 9 LTS added
#8

Updated by Gerrit Code Review almost 2 years ago

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

#9

Updated by Gerrit Code Review almost 2 years ago

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

#10

Updated by Gerrit Code Review almost 2 years ago

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

#11

Updated by Gerrit Code Review almost 2 years ago

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

#12

Updated by Gerrit Code Review almost 2 years ago

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

#13

Updated by Helmut Hummel almost 2 years ago

  • Status changed from Under Review to Needs Feedback

Does this issue still exist?

#14

Updated by Helmut Hummel almost 2 years ago

  • Has duplicate deleted (Bug #87003: Plugins overrides Page Data)
#15

Updated by Helmut Hummel almost 2 years ago

  • Related to deleted (Bug #86979: stdWrap fieldRequired/insertData sometimes not working as expected since TYPO3 9 LTS)
#16

Updated by Riccardo De Contardi over 1 year ago

I tried to reproduce the issue as reported on the issue https://forge.typo3.org/issues/87003 which has been marked as a duplicate, following these steps on TYPO3 9.5.5

1) In a Fluid Page Template, I put:

<f:debug>{data}</f:debug>

and it outputs the data of the page (title, slug,etc)

2) On a page, I put a plugin "Form" element

Results:

The data shown are still that from the page

#17

Updated by Georg Ringer 9 months ago

  • Status changed from Needs Feedback to Closed

this has been solved, don't remember the exact issue but it was about not reusing an existing ContentObjectRenderer but creating a new one.

Also available in: Atom PDF