[TASK] Avoid munging Request in fluid RenderingContext
RenderingContext is *the* state object in fluid. Fluid was always bound to extbase. There was quite some magic between the two: For instance, when extbase calls action "myDetailAction" on "ListController", fluid looks for template "List/MyDetail.html". Fluid derived this from the old extbase request - A request implementation that existed before PSR-7 handling has been introduced to the core. With TYPO3 v11, the extbase request has been turned into a decorator of the PSR-7 object, and fluid has been changed to deal with a standard PSR-7 request. But lots of the fluid related magic tailored to the extbase request remained. Some blockers to relax this have been removed already, most notably the extbase ControllerContext vanished, and the StandaloneView no longer creates an extbase request in its constructor. We can now go a step further: The RenderingContext creates new requests when setControllerAction() and setControllerName(), even cross-triggered when setRequest() is called. This is insane: A rendering engine must never manipulate request itself, but must expect a proper request to hand over by the application. $controllerName and $controllerAction are still important within fluid - it still derives the template files from it if no direct template file is given. But there is no reason to also change the request. All this functionality is bound to the extbase request only. Extbase bootstrap *does* create a proper extbase request already. It can just be hand over as is. setControllerAction() and setControllerName() can be called by extbase abstract ActionController to init fluid properly, reading the values from extbase request itself. Magic within RenderingContext is no longer needed. Resolves: #104471 Related: #96183 Related: #98377 Releases: main Change-Id: I2090230cc37870c0f2a7107ca2af6370ab786175 Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/85346 Reviewed-by:Simon Praetorius <simon@praetorius.me> Tested-by:
Benni Mack <benni@typo3.org> Tested-by:
Christian Kuhn <lolli@schwarzbu.ch> Reviewed-by:
Christian Kuhn <lolli@schwarzbu.ch> Tested-by:
core-ci <typo3@b13.com> Reviewed-by:
Benni Mack <benni@typo3.org> Tested-by:
Simon Praetorius <simon@praetorius.me>
Showing
- typo3/sysext/extbase/Classes/Mvc/Controller/ActionController.php 2 additions, 0 deletions...ysext/extbase/Classes/Mvc/Controller/ActionController.php
- typo3/sysext/fluid/Classes/Core/Rendering/RenderingContext.php 2 additions, 18 deletions.../sysext/fluid/Classes/Core/Rendering/RenderingContext.php
- typo3/sysext/fluid/Tests/Unit/Core/Rendering/RenderingContextTest.php 1 addition, 1 deletion.../fluid/Tests/Unit/Core/Rendering/RenderingContextTest.php
Please register or sign in to comment