[!!!][TASK] Avoid Extbase Request init in StandaloneView
The StandaloneView has a very unfortunate flaw in __construct(): It creates an Extbase Request by default without asking and adds it to RenderingContext. The patch removes this default initialization. StandaloneView is typically *not* used within Extbase context: Extbase by default uses TemplateView. As such, creating an Extbase Request in StandaloneView by default is bad, since it switches context to Extbase when it shouldn't. This can make ViewHelpers behave differently and in general adds trouble and cross dependencies. As a side effect, some ViewHelpers will now actively refuse to work in non-extabse context and throw exceptions. Most notably, f:form and f:form.* throw exceptions when used in a FLUIDTEMPLATE content object. We *might* be able to relax this during further v12 development, though. It is possible we later add a factory to the Fluid views in general that takes care of setting a request to the view. This however needs some streamlining in Fluid standalone library first and requires some further decisions. Change-Id: I1cf7b8a7baf5280d67f887c55b7b6493942c136a Resolves: #98377 Related: #96473 Releases: main Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/75779 Tested-by:Benni Mack <benni@typo3.org> Tested-by:
Stefan Bürk <stefan@buerk.tech> Tested-by:
core-ci <typo3@b13.com> Tested-by:
Christian Kuhn <lolli@schwarzbu.ch> Reviewed-by:
Benni Mack <benni@typo3.org> Reviewed-by:
Stefan Bürk <stefan@buerk.tech> Reviewed-by:
Christian Kuhn <lolli@schwarzbu.ch>
Showing
- typo3/sysext/core/Documentation/Changelog/12.0/Breaking-98377-FluidStandaloneViewDoesNotCreateAnExtbaseRequestAnymore.rst 92 additions, 0 deletions...uidStandaloneViewDoesNotCreateAnExtbaseRequestAnymore.rst
- typo3/sysext/fluid/Classes/View/StandaloneView.php 0 additions, 20 deletionstypo3/sysext/fluid/Classes/View/StandaloneView.php
- typo3/sysext/frontend/Classes/ContentObject/FluidTemplateContentObject.php 1 addition, 0 deletions...tend/Classes/ContentObject/FluidTemplateContentObject.php
- typo3/sysext/frontend/Tests/Unit/ContentObject/FluidTemplateContentObjectTest.php 27 additions, 0 deletions...sts/Unit/ContentObject/FluidTemplateContentObjectTest.php
Please register or sign in to comment