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

Language Switcher does not work properly when using PathPrefix in pure legacy

    Details

      Description

      When there are multiple siteaccesses with different PathPrefix configurations, language switcher does not work properly:

      • switching from a SA. using a path prefix to other one without
      • switching from a SA. without a path prefix to other one with a path prefix
      • Switching between siteaccesses using different path prefixes.
      Steps to reproduce:
      1. Setup 3 different siteaccesses: eng, fre, por
      2. Setup content (use main language availability):
        1. Create a "TestFolder" folder under root (home)
        2. Create a "TestArticle" under "TestFolder"
        3. Translate "TestFolder" to "TestFolderFre" (fre-FR language)
      3. Configure the PathPrefix setting in site.ini:
        1. in "eng" sa: TestFolder
        2. in "fre" sa: TestFolderFre
        3. in "por" sa: none (commented or empty setting)
      4. clear (template) caches
      Verify behavior:
      • Access the site using /TestFolder/TestArticle, switch language to "fre"
      • Access the site using /TestFolder/TestArticle, switch language to "por"
      • Access the site using /por/TestFolder/TestArticle, switch language to "eng"
        (note: switching from a module location such as /content/search should work as expected)

        Issue Links

          Activity

          Show
          Joao Inacio (Inactive) added a comment - Fixed in ezpublish-legacy/master: https://github.com/ezsystems/ezpublish-legacy/commit/e05dc3e03fe9837f34f3f04e1085e5ae626c28d6
          Hide
          Paulo Silva (Inactive) added a comment - - edited

          After applying the patch, I have two distinct situations:
          1st situation
          switching from /por/TestFolder/TestArticle to eng siteaccess, the PathPrefix is ignored and it redirects to eng/TestFolder/TestArticle, instead of eng/TestArticle

          2nd situation
          Switching from /por/TestFolder/TestArticle to fre siteaccess, it redirects to fre/TestFolder/TestArticle which gives a Module non trouvé error, and it's ignoring the defined PathPrefix also.

          [ Oct 31 2014 19:30:16 ] [192.168.2.101] index:
          Undefined module: TestFolder
          [ Oct 31 2014 19:30:16 ] [192.168.2.101] error/view.php:
          Error ocurred using URI: /fre/TestFolder/TestArticle
          

          Show
          Paulo Silva (Inactive) added a comment - - edited After applying the patch, I have two distinct situations: 1st situation switching from /por/TestFolder/TestArticle to eng siteaccess, the PathPrefix is ignored and it redirects to eng/ TestFolder /TestArticle, instead of eng/TestArticle 2nd situation Switching from /por/TestFolder/TestArticle to fre siteaccess, it redirects to fre/TestFolder/TestArticle which gives a Module non trouvé error, and it's ignoring the defined PathPrefix also. [ Oct 31 2014 19:30:16 ] [192.168.2.101] index: Undefined module: TestFolder [ Oct 31 2014 19:30:16 ] [192.168.2.101] error/view.php: Error ocurred using URI: /fre/TestFolder/TestArticle
          Hide
          Jean-Baptiste Bouhier added a comment - - edited

          Hello,

          Has this issue been fixed yet ?
          Thanks

          Edit:
          Oh well, I have the 1st situation with PathPrefix = pathprefix.com
          switching from subdomain.com/folder/article to en-US
          gives me domain.com/pathprefix.com/folder/article without translating
          instead of domain.com/en-US/folder/article

          Which explains a lot.

          Show
          Jean-Baptiste Bouhier added a comment - - edited Hello, Has this issue been fixed yet ? Thanks Edit: Oh well, I have the 1st situation with PathPrefix = pathprefix.com switching from subdomain.com/folder/article to en-US gives me domain.com/pathprefix.com/folder/article without translating instead of domain.com/en-US/folder/article Which explains a lot.
          Hide
          Yannick Roger (Inactive) added a comment -
          Show
          Yannick Roger (Inactive) added a comment - Additional PR by Joao: https://github.com/ezsystems/ezpublish-legacy/pull/1116
          Hide
          Joao Inacio (Inactive) added a comment -
          Show
          Joao Inacio (Inactive) added a comment - Additional fix merged in ezpublish-legacy/master: https://github.com/ezsystems/ezpublish-legacy/commit/24317f20762c508923236bcce8037e029b850f54
          Hide
          Paulo Silva (Inactive) added a comment -

          The fix only works if TestArticle is translated in the same languages as TestFolder, ie translate TestFolder to TestFolderFre (fre-FR language) and inside it TestArticle to TestArticleFre.

          Show
          Paulo Silva (Inactive) added a comment - The fix only works if TestArticle is translated in the same languages as TestFolder, ie translate TestFolder to TestFolderFre (fre-FR language) and inside it TestArticle to TestArticleFre.
          Hide
          Paulo Nunes (Inactive) added a comment - - edited

          Until eZ Publish 4.7, the following actions resulted in:

          #1 /TestFolder/TestArticle, switch language to "fre" OK
          #2 /TestFolder/TestArticle, switch language to "por" OK
          #3 /por/TestFolder/TestArticle, switch language to "eng" OK
          #4 /fre/TestFolderFre/TestArticle, switch language to "eng" Edit: OK after applying EZP-23753 fix (tested on 4.7, since EZP-23753 need backport to eZ Publish 4.5 and 4.6, otherwise this test fails)
          Show
          Paulo Nunes (Inactive) added a comment - - edited Until eZ Publish 4.7, the following actions resulted in: #1 /TestFolder/TestArticle, switch language to "fre" OK #2 /TestFolder/TestArticle, switch language to "por" OK #3 /por/TestFolder/TestArticle, switch language to "eng" OK #4 /fre/TestFolderFre/TestArticle, switch language to "eng" Edit: OK after applying EZP-23753 fix (tested on 4.7, since EZP-23753 need backport to eZ Publish 4.5 and 4.6, otherwise this test fails)
          Hide
          Paulo Nunes (Inactive) added a comment - - edited

          QA Approved

          Tested on eZ Publish 4.5, 4.6, 4.7, 5.0, 5.1, 5.2, 5.3, 5.4 and master

          Show
          Paulo Nunes (Inactive) added a comment - - edited QA Approved Tested on eZ Publish 4.5, 4.6, 4.7, 5.0, 5.1, 5.2, 5.3, 5.4 and master

            People

            • Assignee:
              Unassigned
              Reporter:
              Joao Inacio (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: