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

Cross Siteaccess links not working properly

    Details

      Description

      Currently if you try to generate a cross siteaccess link the path of the target siteaccess isn't cut off from the generated Url.

      This is caused because rootLocationId in here https://github.com/ezsystems/ezpublish-kernel/blob/master/eZ/Publish/Core/MVC/Symfony/Routing/Generator/UrlAliasGenerator.php#L109 is set to the current siteaccess's locationId.

      Therefore the wrong path prefix is generated.

      Somehow rootLocationId in this context should be set for the specified target siteaccess and not used from here https://github.com/ezsystems/ezpublish-kernel/blob/master/eZ/Bundle/EzPublishCoreBundle/EventListener/RoutingListener.php#L57

      See my dirty hack (don't fix it this way): https://gist.github.com/bennyklotz/85747cd3b08ab963580e

        Issue Links

          Activity

          Benjamin Klotz created issue -
          Jérôme Vieilledent (Inactive) made changes -
          Field Original Value New Value
          Status Open [ 1 ] Confirmed [ 10037 ]
          Jérôme Vieilledent (Inactive) made changes -
          Assignee Jérôme Vieilledent [ jerome.vieilledent@ez.no ]
          Jérôme Vieilledent (Inactive) made changes -
          Labels linkGeneration routing
          Fix Version/s 5.3.4 [ 13879 ]
          Fix Version/s 5.4 [ 13180 ]
          Affects Version/s 2014.07 [ 13481 ]
          Affects Version/s 5.3 [ 11282 ]
          Affects Version/s 5.4-dev [ 13485 ]
          Component/s Symfony stack [ 10303 ]
          Jérôme Vieilledent (Inactive) made changes -
          Link This issue relates to EZP-20305 [ EZP-20305 ]
          André Rømcke made changes -
          Fix Version/s 5.4.0-rc1 [ 13883 ]
          Fix Version/s 5.4.0-beta1 [ 13180 ]
          Fix Version/s 5.3.4 [ 13879 ]
          André Rømcke made changes -
          Status Confirmed [ 10037 ] InputQ [ 10001 ]
          André Rømcke made changes -
          Fix Version/s Engineering tracked issues [ 11179 ]
          André Rømcke made changes -
          Fix Version/s 5.4.0-rc1 [ 13883 ]
          André Rømcke made changes -
          Link This issue relates to EZP-23725 [ EZP-23725 ]
          André Rømcke made changes -
          Workflow eZ Engineering Scrumban Workflow [ 64790 ] EZ* Development Workflow [ 69781 ]
          Hide
          Jérôme Vieilledent (Inactive) added a comment -

          Benjamin Klotz Can you please provide clear steps to reproduce?

          Thanks

          Show
          Jérôme Vieilledent (Inactive) added a comment - Benjamin Klotz Can you please provide clear steps to reproduce? Thanks
          Jérôme Vieilledent (Inactive) made changes -
          Status InputQ [ 10001 ] Development [ 3 ]
          Hide
          Benjamin Klotz added a comment -

          I'm no longer a php dev and also no longer working for the company where we had projects which was affected by this.
          The proper gist url is: https://gist.github.com/tak1n/85747cd3b08ab963580e

          Basically the problem was that the rootLocationId always stayed the same regardless of the siteaccess.
          Therefore the link base always was the root siteaccess even for links to other siteaccesses -> generated wrong path (/path/to/siteaccess/my/blog/post instead of /myblog/post)

          Sorry I cannot provide any more reproduction (no access to the git repos of my old company)

          Show
          Benjamin Klotz added a comment - I'm no longer a php dev and also no longer working for the company where we had projects which was affected by this. The proper gist url is: https://gist.github.com/tak1n/85747cd3b08ab963580e Basically the problem was that the rootLocationId always stayed the same regardless of the siteaccess. Therefore the link base always was the root siteaccess even for links to other siteaccesses -> generated wrong path (/path/to/siteaccess/my/blog/post instead of /myblog/post) Sorry I cannot provide any more reproduction (no access to the git repos of my old company)
          Hide
          Jérôme Vieilledent (Inactive) added a comment -

          Hi

          I cannot reproduce this issue, generated links seem to be perfectly OK.
          Here's my setup:

          ezpublish.yml

          • 2 Siteaccesses (ezdemo_site and eng)
          • Default siteaccess: eng
          • ezdemo_site is configured with a tree root (see following yaml from my ezpublish.yml)

          ezpublish:
              siteaccess:
                  default_siteaccess: eng
                  list:
                      - ezdemo_site
                      - eng
                      - ezdemo_site_admin
                  groups:
                      ezdemo_site_group:
                          - ezdemo_site
                          - eng
                          - ezdemo_site_admin
                  match:
                      URIElement: '1'
              system:
                  ezdemo_site_group:
                      repository: eng_repository
                      var_dir: var/ezdemo_site
                  eng:
                      languages:
                          - eng-GB
                      session:
                          name: eZSESSID
           
                  ezdemo_site:
                      languages:
                          - eng-GB
                          - fre-FR
                      session:
                          name: eZSESSID
                      content:
                          tree_root:
                              location_id: 61
           
                  ezdemo_site_admin:
                      languages:
                          - eng-GB
                          - fre-FR
          

          Adding cross-siteaccess links

          I modified page_header.html.twig from DemoBundle, for a quick reproduction, to add the following code:

          <ul>
              <li><a href="{{ path("ez_urlalias", {"locationId": 73, "siteaccess": 'ezdemo_site'}) }}">Foo ezdemo_site</a></li>
              <li><a href="{{ path("ez_urlalias", {"locationId": 73, "siteaccess": 'eng'}) }}">Foo eng</a></li>
          </ul>
          

          This generates following links:

          <ul>
              <li><a href="/ezdemo_site/Selected-Features/Getting-Started-with-eZ-Publish-Platform">Foo ezdemo_site</a></li>
              <li><a href="/eng/Getting-Started/Selected-Features/Getting-Started-with-eZ-Publish-Platform">Foo eng</a></li>
          </ul>
          

          Generated links are perfectly valid to me. ezdemo_site is indeed configured to begin under Getting-Started (location #61).

          Show
          Jérôme Vieilledent (Inactive) added a comment - Hi I cannot reproduce this issue, generated links seem to be perfectly OK. Here's my setup: ezpublish.yml 2 Siteaccesses ( ezdemo_site and eng ) Default siteaccess: eng ezdemo_site is configured with a tree root (see following yaml from my ezpublish.yml) ezpublish: siteaccess: default_siteaccess: eng list: - ezdemo_site - eng - ezdemo_site_admin groups: ezdemo_site_group: - ezdemo_site - eng - ezdemo_site_admin match: URIElement: '1' system: ezdemo_site_group: repository: eng_repository var_dir: var/ezdemo_site eng: languages: - eng-GB session: name: eZSESSID   ezdemo_site: languages: - eng-GB - fre-FR session: name: eZSESSID content: tree_root: location_id: 61   ezdemo_site_admin: languages: - eng-GB - fre-FR Adding cross-siteaccess links I modified page_header.html.twig from DemoBundle, for a quick reproduction, to add the following code: <ul> <li><a href="{{ path("ez_urlalias", {"locationId": 73, "siteaccess": 'ezdemo_site'}) }}">Foo ezdemo_site</a></li> <li><a href="{{ path("ez_urlalias", {"locationId": 73, "siteaccess": 'eng'}) }}">Foo eng</a></li> </ul> This generates following links: <ul> <li><a href="/ezdemo_site/Selected-Features/Getting-Started-with-eZ-Publish-Platform">Foo ezdemo_site</a></li> <li><a href="/eng/Getting-Started/Selected-Features/Getting-Started-with-eZ-Publish-Platform">Foo eng</a></li> </ul> Generated links are perfectly valid to me. ezdemo_site is indeed configured to begin under Getting-Started (location #61).
          Jérôme Vieilledent (Inactive) made changes -
          Status Development [ 3 ] Development Review done [ 10028 ]
          Assignee Jérôme Vieilledent [ jerome.vieilledent@ez.no ]
          Jérôme Vieilledent (Inactive) made changes -
          Status Development Review done [ 10028 ] Documentation Review done [ 10011 ]
          Hide
          Jérôme Vieilledent (Inactive) added a comment -

          QA: Can you please test this issue, at in master/5.4/5.3? Maybe there is a missing backport somewhere?

          Thanks

          Show
          Jérôme Vieilledent (Inactive) added a comment - QA: Can you please test this issue, at in master/5.4/5.3? Maybe there is a missing backport somewhere? Thanks
          Miguel das Neves Jacinto (Inactive) made changes -
          Status Documentation Review done [ 10011 ] QA [ 10008 ]
          Hide
          Miguel das Neves Jacinto (Inactive) added a comment -

          [~jerome.vieilledent@ez.no] I think this issue has already been fixed, see EZP-24399

          Show
          Miguel das Neves Jacinto (Inactive) added a comment - [~jerome.vieilledent@ez.no] I think this issue has already been fixed, see EZP-24399
          Hide
          Jérôme Vieilledent (Inactive) added a comment -

          OK thanks. I'll close it then.

          Show
          Jérôme Vieilledent (Inactive) added a comment - OK thanks. I'll close it then.
          Jérôme Vieilledent (Inactive) made changes -
          Link This issue duplicates EZP-24399 [ EZP-24399 ]
          Jérôme Vieilledent (Inactive) made changes -
          Assignee Miguel das Neves Jacinto [ miguel.jacinto@ez.no ]
          Status QA [ 10008 ] Closed [ 6 ]
          Resolution Duplicate [ 3 ]
          Alex Schuster made changes -
          Workflow EZ* Development Workflow [ 69781 ] EZEE Development Workflow [ 124234 ]
          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open Confirmed Confirmed
          3m 27s 1 jerome.vieilledent@ez.no 10/Oct/14 11:42 AM
          Confirmed Confirmed InputQ InputQ
          53d 6h 9m 1 André Rømcke 02/Dec/14 4:52 PM
          InputQ InputQ Development Development
          205d 16h 6m 1 jerome.vieilledent@ez.no 26/Jun/15 9:59 AM
          Development Development Development Review done Development Review done
          6d 5h 31m 1 jerome.vieilledent@ez.no 02/Jul/15 3:30 PM
          Development Review done Development Review done Documentation Review done Documentation Review done
          4s 1 jerome.vieilledent@ez.no 02/Jul/15 3:31 PM
          Documentation Review done Documentation Review done QA QA
          38m 53s 1 miguel.jacinto@ez.no 02/Jul/15 4:09 PM
          QA QA Closed Closed
          48m 6s 1 jerome.vieilledent@ez.no 02/Jul/15 4:58 PM

            People

            • Assignee:
              Unassigned
              Reporter:
              Benjamin Klotz
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: