Skip to content
  • Christian Kuhn's avatar
    [TASK] Avoid munging Request in fluid RenderingContext · 2d89d93d
    Christian Kuhn authored
    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: default avatarSimon Praetorius <simon@praetorius.me>
    Tested-by: default avatarBenni Mack <benni@typo3.org>
    Tested-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
    Reviewed-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
    Tested-by: default avatarcore-ci <typo3@b13.com>
    Reviewed-by: default avatarBenni Mack <benni@typo3.org>
    Tested-by: default avatarSimon Praetorius <simon@praetorius.me>
    2d89d93d