#105325Nested StandaloneView (FluidTemplate) inherits Extbase request from TemplateView
Description
Setup
Extbase Extension with a Controller “Seminars” and an action “Show”.
The corresponding “Show.html” Fluid template contains:
<f:cObject typoscriptObjectPath="lib.someContent">
So it renders some regular content:
lib.someContent < styles.content.get
lib.someContent.select.pidInList = 123
The selected content contains an Extbase Plugin.
Expected behavior
Browser should display the content loaded via lib.someContent.
This works just fine up to v11.
Actual behavior
Exception that “Seminars/Show.html” can’t be found in paths. (where the paths are the regular Fluid Styled Content paths)
Analysis
The Fluid template setup above creates technically a nesting of TemplateView (Show-Action) and StandaloneView (FluidTemplate via f:cObject).
Unluckily, the StandaloneView gets passed the Extbase-Request from the Show-Action, which causes this request being passed down to the TYPO3\CMS\Fluid\Core\Rendering\RenderingContext::setRequest causing the Controller/Action of the FluidTemplate to be overwritten.
While it is desirable that StandaloneView itself can handle Extbase Requests for other use cases like E-Mail and stuff, this should not be the case when an isolated context is required, like in the f:cObject case.
Ideas for solution
Fix CObjectViewHelper to “revert” the request properly, e.g. by using the initial requst from $GLOBALS[TYPO3_REQUEST] instead of the more specific one in its own renderingContext.
Reviews 3
Related issues 1
History 914
-
Markus Klein changed description <span data-processor="relativetime" data-value="2024-10-16T14:59:12+00:00" > 10/16/24, 14:59 </span>
-
Garvin Hicking changed Related to #104773 <span data-processor="relativetime" data-value="2024-10-16T16:14:00+00:00" > 10/16/24, 16:14 </span>
-
Markus Klein commented <span data-processor="relativetime" data-value="2024-10-17T07:10:27+00:00" > 10/17/24, 07:10 </span>
The fix above works for v12, I’ll try to do some testing in v13 too.
-
Gerrit Code Review pushed patch set 1 for 12.4 to change 86633 status
NewUnder Review <span data-processor="relativetime" data-value="2024-10-17T07:14:06+00:00" > 10/17/24, 07:14 </span> -
Gerrit Code Review pushed patch set 1 for main to change 86828 <span data-processor="relativetime" data-value="2024-10-29T15:22:37+00:00" > 10/29/24, 15:22 </span>
-
Gerrit Code Review pushed patch set 2 for 12.4 to change 86633 <span data-processor="relativetime" data-value="2024-10-29T15:23:09+00:00" > 10/29/24, 15:23 </span>
-
Markus Klein changed description <span data-processor="relativetime" data-value="2025-03-17T12:09:25+00:00" > 03/17/25, 12:09 </span>
-
Markus Klein commented <span data-processor="relativetime" data-value="2025-03-17T15:23:22+00:00" > 03/17/25, 15:23 </span>
The content of this issue evolved over time, I’ll try to provide a new warp up.
-
Markus Klein commented <span data-processor="relativetime" data-value="2025-03-17T19:52:55+00:00" > 03/17/25, 19:52 </span>
This issue is only present in v12. To reproduce:
- Install ext:news
- Install ext:plain_faq (or any other extbase-based extension)
- Install fluid_styled_content
- Add necessary base TS templates (FSC, news, plain_faq)
- Configure a default extension name for FSC in TypoScript:
lib.contentElement.extbase.controllerExtensionName = Sitesetup - Create a sysfolder “data”
- Create 1 FAQ record
- Create 1 News record: Add a content element there with the plainfaq list plugin (select storage folder “data”)
- Add “news detail” plugin to a page and select the created news article there
- View the page
The error will be:
> #1257246929 TYPO3Fluid\Fluid\View\Exception\InvalidTemplateResourceException
> Tried resolving a template file for controller action “News->detail” in format “.html”, but none of the paths contained the expected template file (News/Detail.html). The following paths were checked: /var/www/html/vendor/typo3/cms-fluid-styled-content/Resources/Private/Templates/, /var/www/html/vendor/reelworx/sitesetup/Resources/Private/Templates/Content/Note: This error does not occur if
lib.contentElement.extbase.controllerExtensionNameis NOT set!(The code is gone in v13 with https://review.typo3.org/c/Packages/TYPO3.CMS/+/85348/3/typo3/sysext/frontend/Classes/ContentObject/FluidTemplateContentObject.php#b219. Code-wise v13 still passes along the “extbase-enriched” request through the cObject-ViewHelper, but it won’t matter here.)
-
Gerrit Code Review pushed patch set 3 for 12.4 to change 86633 <span data-processor="relativetime" data-value="2025-03-17T19:55:32+00:00" > 03/17/25, 19:55 </span>
-
Gerrit Code Review pushed patch set 4 for 12.4 to change 86633 <span data-processor="relativetime" data-value="2025-03-18T07:56:11+00:00" > 03/18/25, 07:56 </span>
-
Benni Mack commented and changed status
Under ReviewClosed <span data-processor="relativetime" data-value="2026-05-04T13:24:31+00:00" > 05/04/26, 13:24 </span>support for 12.4 version in the free version has been dropped.
Probably better change in the viewhelper