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

SiteAccess and other request attributes lost in sub-requests

    XMLWordPrintable

    Details

      Description

      When doing a subrequest, you lose critical information like the siteaccess, or the semanticPathinfo (used by helper ezpublish.requestedUriString).
      When using ESI or Hinclude strategies, it's really problematic since the default siteaccess is used then and thus the right configuration is not used and links are not generated correctly.

      Steps to reproduce

      • Use a siteaccess that is not your default one
      • Create your pagelayout.html.twig
      • On this template try to dump
        {{ dump( ezpublish.requestedUriString ) }}
        • Result is okay (for example i got "/" )
      • Create an override (ex: welcome.html.twig)
        • On this template try to dump ezpublish.requestedUriString
        • Result is Okay (i got "/")
        • Dump the siteaccess name ezpublish.siteaccess.name
      • Create a subrequest using either Hinclude or ESI strategy on welcome.html.twig something like
        {{ render_hinclude( controller( "AcmeDemoBundle:Test:MyAction" )) }}
        • Create a template for this render and dump parameter and siteaccess name
        • Result is ko (got null as answer for ezpublish.requestedUriString and my siteaccess is the default one).

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              philippe.vincent-royol@ez.no Philippe Vincent-Royol
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 2 days, 6 hours, 20 minutes
                  2d 6h 20m