Project

General

Profile

Actions

Bug #76489

closed

f:cObject resets other global parameters in fluid_styled_content

Added by Stephan Bauer almost 8 years ago. Updated about 4 years 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 1 (0 open1 closed)

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

Actions
Actions #1

Updated by Claus Due almost 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.

Actions #2

Updated by Claus Due almost 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``.

Actions #3

Updated by Gerrit Code Review over 5 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

Actions #4

Updated by Gerrit Code Review over 5 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

Actions #5

Updated by Gerrit Code Review over 5 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

Actions #6

Updated by Georg Ringer over 5 years ago

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

Updated by Josef Glatz over 5 years ago

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

Updated by Gerrit Code Review over 5 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

Actions #9

Updated by Gerrit Code Review over 5 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

Actions #10

Updated by Gerrit Code Review over 5 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

Actions #11

Updated by Gerrit Code Review over 5 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

Actions #12

Updated by Gerrit Code Review over 5 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

Actions #13

Updated by Helmut Hummel over 5 years ago

  • Status changed from Under Review to Needs Feedback

Does this issue still exist?

Actions #14

Updated by Helmut Hummel over 5 years ago

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

Updated by Helmut Hummel over 5 years ago

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

Updated by Riccardo De Contardi about 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

Actions #17

Updated by Georg Ringer about 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.

Actions

Also available in: Atom PDF