Bug #76489
closedf:cObject resets other global parameters in fluid_styled_content
0%
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.
Updated by Claus Due over 8 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.
Updated by Claus Due over 8 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``.
Updated by Gerrit Code Review almost 6 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
Updated by Gerrit Code Review almost 6 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
Updated by Gerrit Code Review almost 6 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
Updated by Georg Ringer almost 6 years ago
- Has duplicate Bug #87003: Plugins overrides Page Data added
Updated by Josef Glatz almost 6 years ago
- Related to Bug #86979: stdWrap fieldRequired/insertData sometimes not working as expected since TYPO3 9 LTS added
Updated by Gerrit Code Review almost 6 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
Updated by Gerrit Code Review almost 6 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
Updated by Gerrit Code Review almost 6 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
Updated by Gerrit Code Review almost 6 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
Updated by Gerrit Code Review almost 6 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
Updated by Helmut Hummel almost 6 years ago
- Status changed from Under Review to Needs Feedback
Does this issue still exist?
Updated by Helmut Hummel almost 6 years ago
- Has duplicate deleted (Bug #87003: Plugins overrides Page Data)
Updated by Helmut Hummel almost 6 years ago
- Related to deleted (Bug #86979: stdWrap fieldRequired/insertData sometimes not working as expected since TYPO3 9 LTS)
Updated by Riccardo De Contardi over 5 years 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
Updated by Georg Ringer over 4 years 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.