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

Error in UrlAliasService:matchLanguageCode() with same path string in differents languages

    Details

      Description

      The UrlAliasService:matchLanguageCode() doesn't works well with translations. (eZ/Publish/Core/Repository/URLAliasService.php
      L.396)
      In foreach(), the languages are not ordered according to current siteaccess.
      So, it returns the first match which isn't necessary in the current siteaccess's language.

      Example :

      • You have a article named "Media" with 2 translations, fre-FR, the main, and eng-GB
      • The word "Media" is the same in french and english
      • In the english siteaccess, from any page, you click on a link to the "Media" page
      • In the matchLanguageCode(), fre-FR comes first and $pathElement match with $translation, so fre-FR is returned as the current language code, when in reality it's eng-GB

        Issue Links

          Activity

          Show
          Benjamin Choquet added a comment - PR : https://github.com/ezsystems/ezpublish-kernel/pull/824
          Show
          Jérôme Vieilledent (Inactive) added a comment - Fixed in master: https://github.com/ezsystems/ezpublish-kernel/commit/4f053ed0102149265cc6e06168c4f6f133556a6a
          Hide
          Peter Keung added a comment -

          This should be released as an official 5.2 service pack, as it is crucial for multi-language sites.

          Show
          Peter Keung added a comment - This should be released as an official 5.2 service pack, as it is crucial for multi-language sites.
          Hide
          Petar Spanja (Inactive) added a comment -

          Pull request with unit tests and some minor improvements: https://github.com/ezsystems/ezpublish-kernel/pull/983

          Show
          Petar Spanja (Inactive) added a comment - Pull request with unit tests and some minor improvements: https://github.com/ezsystems/ezpublish-kernel/pull/983
          Hide
          Petar Spanja (Inactive) added a comment -
          Show
          Petar Spanja (Inactive) added a comment - PR #983 merged to ezpublish-kernel/master in https://github.com/ezsystems/ezpublish-kernel/commit/0eead3a235ca75b7704223c82cb5aa0b2d05961f .
          Hide
          Paulo Nunes (Inactive) added a comment -

          QA Approved
          Tested on 5.2, 5.3 and Master

          Show
          Paulo Nunes (Inactive) added a comment - QA Approved Tested on 5.2, 5.3 and Master

            People

            • Assignee:
              Unassigned
              Reporter:
              Mathieu Maury
            • Votes:
              0 Vote for this issue
              Watchers:
              13 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 - 1 week, 3 hours, 35 minutes
                1w 3h 35m