Details
-
Bug
-
Resolution: Fixed
-
Medium
-
5.1
-
None
Description
Embedding legacy output in twig pagelayout results in html and body tags being rendered twice
Steps to reproduce
- create a MyCcookbookBundle
- add into parameters.yml
ezpublish_legacy.default.module_default_layout: 'MyCookbookBundle::pagelayout.html.twig'
- set pagelayout.html.twig as shown in Legacy template fallback
<!DOCTYPE html> <!--[if lt IE 9 ]><html class="unsupported-ie ie" lang=""><![endif]--> <!--[if IE 9 ]><html class="ie ie9" lang=""><![endif]--> <!--[if (gt IE 9)|!(IE)]><!--><html lang=""><!--<![endif]--> <head> {# TODO: this probably won't be needed anymore as we will relay on the HTTP cache #} {% include 'eZDemoBundle::page_head_displaystyles.html.twig' with { 'user': user } %} <meta name="viewport" content="width=device-width, initial-scale=1.0"/> {% include 'eZDemoBundle::page_head.html.twig' %} {% include 'eZDemoBundle::page_head_style.html.twig' %} {% include 'eZDemoBundle::page_head_script.html.twig' %} <script>alert("beh");</script> </head> <body> {% block content %} {# module_result variable is received from the legacy controller. #} {# It holds the legacy module result #} {{ module_result.content|raw }} {% endblock %} </body> </html>
- fetch user/login with curl (browsers might masquerade the results)
curl http:<front-end-site>/user/login | grep body
=> Expected result: only one body tag should be present
=> Actual result: body tag will be opened and closed twice
(denoting that the body tag is being rendered twice)