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

SiteAccess and other request attributes lost in sub-requests

    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).

        Issue Links

          Activity

          Hide
          Bertrand Dunogier added a comment -

          I get a fatal error when running ezpublish/console, Class 'eZ\Bundle\EzPublishCoreBundle\SiteAccess' not found in vendor/ezsystems/ezpublish-kernel/eZ/Bundle/EzPublishCoreBundle/Console/Application.php on line 50.

          Show
          Bertrand Dunogier added a comment - I get a fatal error when running ezpublish/console, Class 'eZ\Bundle\EzPublishCoreBundle\SiteAccess' not found in vendor/ezsystems/ezpublish-kernel/eZ/Bundle/EzPublishCoreBundle/Console/Application.php on line 50.
          Show
          Jérôme Vieilledent (Inactive) added a comment - PR (merged) : https://github.com/ezsystems/ezpublish-kernel/pull/346
          Show
          Jérôme Vieilledent (Inactive) added a comment - Thanks, fixed in master: https://github.com/ezsystems/ezpublish-kernel/commit/01fccfa046e12ea533d854d42458154aaa0486a4
          Hide
          Joao Pingo (Inactive) added a comment -

          Tested using tc-1586 and tc-1588
          Tests passed ... QA Done

          Show
          Joao Pingo (Inactive) added a comment - Tested using tc-1586 and tc-1588 Tests passed ... QA Done
          Hide
          Jérôme Vieilledent (Inactive) added a comment -

          Regression: EZP-21695

          Show
          Jérôme Vieilledent (Inactive) added a comment - Regression: EZP-21695

            People

            • Assignee:
              Unassigned
              Reporter:
              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