Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-25960

Double layout using legacy /layout/set module and LegacyKernelController

    XMLWordPrintable

Details

    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

        Activity

          People

            Unassigned Unassigned
            9e9f2c72-d8ff-4ec0-b8df-c5a744234b9a@accounts.ibexa.co Jérôme Vieilledent
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: