Review main Merged

86687[BUGFIX] Respect `templateName` for fluid template assets rendering

Stefan Rumzucker CR +2 V +2 Easy +8 −3 updated 11/07/24, 08:49

Commit message

Rendering assets in fluid templates via the special
"HeaderAssets" and "FooterAssets" sections does now
properly work with a given "templateName" by rendering
the "view" before assets rendering takes place, as this
does internally correctly set the template name.

Review

  • Code review CR +2 Done
    • Oli Bartsch +2
    • Benni Mack +1
  • Verified V +2 Done
    • Oli Bartsch +2
    • Benni Mack +1
    • core-ci +1 CI

Issues 1

Files 3

Review log 2227

Show 12 earlier messages
  1. Stefan Rumzucker uploaded patch set 1 10/22/24, 11:26

  2. core-ci voted on patch set 1 V +1 10/22/24, 11:31 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/68363

  1. Simon Praetorius commented on patch set 1 10/22/24, 14:05

    Could you add a short explanation about the issue to your commit message? It would also be great if we could cover this with a new test case. Let me know (e. g. via Slack) if you need any help with that.
  2. Oli Bartsch commented on patch set 1 10/22/24, 15:42

    FluidTemplateContentObject.php:138

    Just from reading, I wonder if instead of moving the time of rendering we should just set the controller action here? `$view->getRenderingContext()->setControllerAction($templateFilename);`
  3. Christian Kuhn commented on patch set 1 10/22/24, 15:51

    FluidTemplateContentObject.php:138 Reply

    no. please don't add this extbase specific thing back at this point.
  4. Oli Bartsch commented on patch set 1 10/22/24, 18:24

    FluidTemplateContentObject.php:138 Reply

    Ack. However, we have to ensure that the move of the rendering does not have any side effects.
  5. Stefan Rumzucker uploaded patch set 2 V +1 10/22/24, 18:55

  6. core-ci voted on patch set 2 V +1 10/22/24, 19:00 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/68396

  7. Stefan Rumzucker commented on patch set 2 10/22/24, 21:01

    FluidTemplateContentObject.php:138 Reply

    Right, this would change the order of the collected header respectively footer data. We could provide the template name in `FluidViewAdapter::renderSection` where `setControllerAction` could be called accordingly. What's the actual reason to deprecate `FluidViewAdapter::setTemplate`. Wouldn't it be a straight forward way to define it like this? ``` $view->setTemplate($templateFilename); $this->renderFluidTemplateAssetsIntoPageRenderer($view, $variables); $content = $view->render(); ``` As `$view->render($templateFilename)` would also change the state of the rendering context in terms of the controller action, why don't do it explicitly with `$view->setTemplate($templateFilename)` up front?
  8. Simon Praetorius commented on patch set 2 10/23/24, 08:57

    FluidTemplateContentObject.php:138 Reply

    I would propose the following: * add a third argument `$templateFilename` to `renderFluidTemplateAssetsIntoPageRenderer()` and set the controllerAction there (like oli suggested) to make it clear that this is necessary because of the `renderSection()` calls * Keep using `$view->render($templateFilename)` at the original position after the page renderer stuff It's unfortunate that `renderSection()` depends on state that is not provided to the function, but we can't resolve this at the moment.
  9. Stefan Rumzucker uploaded patch set 3 V +1 10/23/24, 13:51

  10. Oli Bartsch commented on patch set 3 10/23/24, 13:54

    FluidTemplateContentObject.php:138 Reply

    Quite unsure whether we should call `setControllerAction` after Christian’s comment.
  11. core-ci voted on patch set 3 V +1 10/23/24, 13:58 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/68459

  12. Stefan Rumzucker commented on patch set 3 10/23/24, 14:00

    FluidTemplateContentObject.php:138 Reply

    Well, then I'm out of options ^^. We could move this to the `FluidViewAdapter` which is basically what `FluidViewAdapter::setTemplate` already does. But it's deprecated and suggests to use `setControllerAction`.
  13. Christian Kuhn commented on patch set 3 10/23/24, 17:38

    i'll have another detail look soon, as well.
  14. Oli Bartsch commented on patch set 3 10/23/24, 17:39

    FluidTemplateContentObject.php:138 Reply

    We might just stick with the first version and move the render() call. Let's wait for @lolli@schwarzbu.ch .
  15. Stefan Rumzucker commented on patch set 3 11/05/24, 12:51

    FluidTemplateContentObject.php:138 Reply

    Any update on this one? Would be great if we could make that work in the upcoming release.
  16. Oli Bartsch uploaded patch set 4 V +1 11/06/24, 07:58

  17. Oli Bartsch commented on patch set 4 11/06/24, 07:58

    FluidTemplateContentObject.php:138 Reply

    Talked to lolli a couple of days ago and I still think, we should just stick with your first version, moving the render call. I updated the patch accordingly.
  18. Oli Bartsch voted on patch set 4 CR +1 V +1 11/06/24, 07:58

  19. core-ci voted on patch set 4 V +1 11/06/24, 08:05 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/69135

  20. Oli Bartsch updated the commit message in patch set 5 CR +1 V +1 11/06/24, 08:07

  21. Oli Bartsch voted on patch set 5 CR +1 V +1 11/06/24, 08:07

  22. core-ci voted on patch set 5 V +1 11/06/24, 08:14 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/69136

  23. Benni Mack voted on patch set 5 CR +1 V +1 11/06/24, 08:35

  24. Oli Bartsch voted on patch set 5 CR +2 V +2 11/06/24, 09:29

  25. Oli Bartsch merged patch set 6 11/07/24, 08:49