Details
-
Bug
-
Resolution: Fixed
-
High
-
5.3.8, 5.4.6
-
None
Description
Hi
When using /layout/set legacy module through LegacyKernelController having a module layout configured, result from legacy kernel is rendered using this module layout.
However, when using /layout/set, you already define a layout in legacy stack (via layout.ini. Problem is that the result from /layout/set will be embedded in the configured module layout, which can give very unexpected results.
Best example is that when you want to render XML, JSON or anything not HTML, you'll have the result embedded in some HTML layout.
Example
Module layout configuration
With the following config, AcmeLegacyTestBudle::pagelayout_legacy.html.twig will be used for rendering result from legacy modules.
ez_publish_legacy: system: my_site: templating: view_layout: "AcmeLegacyTestBundle::pagelayout.html.twig" module_layout: "AcmeLegacyTestBudle::pagelayout_legacy.html.twig"
layout.ini (legacy kernel)
[css] PageLayout=plainlayout.tpl ContentType=text/css
With this config, you expect that plainlayout.tpl will be used (goal is to render CSS code obviously), using text/css content type.
Problem
When calling /layout/set/css/content/view/css/1234, content will be:
- rendered using plainlayout.tpl by legacy kernel => OK
- rendered using AcmeLegacyTestBudle::pagelayout_legacy.html.twig by LegacyKernelController => Not OK as this layout contains HTML code.
Attachments
Issue Links
- links to