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

language switcher : UrlAliasGenerator generate wrong url when there is always available

    Details

      Description

      Language switcher generates an internal url (e.g. /ger/content/location/63) when the other language doesn't exist and have the always available flag.

        Issue Links

          Activity

          Show
          Sebastian Blank added a comment - PR: https://github.com/ezsystems/ezpublish-kernel/pull/1258
          Show
          Jérôme Vieilledent (Inactive) added a comment - Fixed in master: https://github.com/ezsystems/ezpublish-kernel/commit/1f9b5fa604cc5201ce3b58287f67300b01a04a82
          Hide
          Rui Silva (Inactive) added a comment -

          @Sebastian Blank, we need more specified details on how to reproduce this issue.
          My approach was: on the frontend, I've tried to change the Language Switcher on the display page of a content Folder (created only on Eng without Fre translation), from Eng to Fre siteaccess. 'Always Available' option of my content was checked. I couldn't see any irregular behaviour with the urls.
          Please refer if there are any steps needed to take in between or if something I described doesn't match the way you reproduced the issue.
          Thanks.

          Show
          Rui Silva (Inactive) added a comment - @Sebastian Blank, we need more specified details on how to reproduce this issue. My approach was: on the frontend, I've tried to change the Language Switcher on the display page of a content Folder (created only on Eng without Fre translation), from Eng to Fre siteaccess. 'Always Available' option of my content was checked. I couldn't see any irregular behaviour with the urls. Please refer if there are any steps needed to take in between or if something I described doesn't match the way you reproduced the issue. Thanks.
          Hide
          Sebastian Blank added a comment -

          @Rui Silva: Here the steps to reproduce this issue:

          1. Create ezplatform + legacybridge with following setup
          php ezpublish/console ezplatform:install demo
          3. Configure an legacy admin "demo_site_admin"
          4. Create a second language: German
          5. Set the "Getting Started" Landing Page to AlwaysAvailable
          7. Create an German Siteaccess "demo_site_de"
          10. Make following settings under ezpublish/config/ezpublish.yml:
          https://gist.github.com/blankse/308844f62640d2088416
          11. Open the "Getting Started" Landing Page on the english "demo_site" siteaccess.
          With this change the language switcher on the top has the href "http://localhost/demo_site_de/Getting-Started", without "http://localhost/demo_site_de/content/location/2".

          I hope you can find here your answer.

          Show
          Sebastian Blank added a comment - @Rui Silva: Here the steps to reproduce this issue: 1. Create ezplatform + legacybridge with following setup php ezpublish/console ezplatform:install demo 3. Configure an legacy admin "demo_site_admin" 4. Create a second language: German 5. Set the "Getting Started" Landing Page to AlwaysAvailable 7. Create an German Siteaccess "demo_site_de" 10. Make following settings under ezpublish/config/ezpublish.yml: https://gist.github.com/blankse/308844f62640d2088416 11. Open the "Getting Started" Landing Page on the english "demo_site" siteaccess. With this change the language switcher on the top has the href "http://localhost/demo_site_de/Getting-Started", without "http://localhost/demo_site_de/content/location/2". I hope you can find here your answer.
          Hide
          Rui Silva (Inactive) added a comment -

          @Sebastian Blank, which specific settings in particular do I need to apply from the ezpublish.yml that you show to be able to reproduce the issue? It's highly different from a default installation yml setup and your ezpublish.yml may mislead me with unnecessary changes I would do.

          Show
          Rui Silva (Inactive) added a comment - @Sebastian Blank, which specific settings in particular do I need to apply from the ezpublish.yml that you show to be able to reproduce the issue? It's highly different from a default installation yml setup and your ezpublish.yml may mislead me with unnecessary changes I would do.
          Hide
          Sebastian Blank added a comment - - edited

          @Rui Silva:
          Following changes should be enough compared to the standard version after the ezplatform:install command:

          • Add demo_site_de to ezpublish/siteaccess/list
          • Add demo_site_de to ezpublish/siteaccess/groups/demo_site_group
          • Remove ezpublish/system/demo_site_group/languages: [eng-GB]
          • Add ezpublish/system/demo_site_group/translation_siteaccesses: [demo_site, demo_site_de]
          • Add ezpublish/system/demo_site/languages: [eng-GB]
          • Add ezpublish/system/demo_site_de/languages: [ger-DE]

          The other changes was for the legacy backend to set the AlwaysAvailable and for Windows

          Show
          Sebastian Blank added a comment - - edited @Rui Silva: Following changes should be enough compared to the standard version after the ezplatform:install command: Add demo_site_de to ezpublish/siteaccess/list Add demo_site_de to ezpublish/siteaccess/groups/demo_site_group Remove ezpublish/system/demo_site_group/languages: [eng-GB] Add ezpublish/system/demo_site_group/translation_siteaccesses: [demo_site, demo_site_de] Add ezpublish/system/demo_site/languages: [eng-GB] Add ezpublish/system/demo_site_de/languages: [ger-DE] The other changes was for the legacy backend to set the AlwaysAvailable and for Windows
          Hide
          Rui Silva (Inactive) added a comment -

          @Sebastian Blank, thank you for the specific configurations you provided.
          Since Language Switcher was implemented only for 5.3 and master ( https://jira.ez.no/browse/EZP-22464 ) I'm not being able to reproduce this issue on a 5.4 using the LanguageSwitcher itself.
          I tried however to generate the url (much like the Language Switcher itself does) via a Controller of a custom bundle. I'm not being able to see the issue fixed (on the 5.4 only). It continues to generate my url as:
          http://ezp54.rui/ger/content/location/61
          instead of:
          http://ezp54.rui/ger/Getting Started
          Anyone have any insight on this?
          I'm attaching the custom bundle I'm trying to test with.

          Show
          Rui Silva (Inactive) added a comment - @Sebastian Blank, thank you for the specific configurations you provided. Since Language Switcher was implemented only for 5.3 and master ( https://jira.ez.no/browse/EZP-22464 ) I'm not being able to reproduce this issue on a 5.4 using the LanguageSwitcher itself. I tried however to generate the url (much like the Language Switcher itself does) via a Controller of a custom bundle. I'm not being able to see the issue fixed (on the 5.4 only). It continues to generate my url as: http://ezp54.rui/ger/content/location/61 instead of: http://ezp54.rui/ger/Getting Started Anyone have any insight on this? I'm attaching the custom bundle I'm trying to test with.
          Hide
          Rui Silva (Inactive) added a comment -

          I retested this on 5.4, by adapting my testing bundle, now using on my template:

          {{ url( 'ez_urlalias', { 'locationId' : 61, 'siteaccess' : 'ger' }) }}
          

          instead of:

          <p>{{ url( ez_route( locationObject, {"language": language} ) ) }}</p>
          

          The fix thereby seems to work, as ez_urlalias generates the following URL:
          http://ezp54.rui/ger/Getting-Started
          (right siteaccess and correctly composed URL)
          instead of:
          http://ezp54.rui/ger/eng/content/location/61
          (two siteaccesses and incorrectly composed URL)
          which is what is expected, much alike the behaviour of a language switcher.
          However, using ez_route, from an eng siteaccess, like:

          <p>{{ url( ez_route( locationObject, {"language": language} ) ) }}</p>
          

          I always get:
          http://ezp54.rui/eng/Getting-Started
          Is this expected behaviour of the normal usage of ez_route?
          Should this situation (if deemed abnormal / unexpected) be considered a different issue from this?

          Show
          Rui Silva (Inactive) added a comment - I retested this on 5.4, by adapting my testing bundle, now using on my template: {{ url( 'ez_urlalias', { 'locationId' : 61, 'siteaccess' : 'ger' }) }} instead of: <p>{{ url( ez_route( locationObject, {"language": language} ) ) }}</p> The fix thereby seems to work, as ez_urlalias generates the following URL: http://ezp54.rui/ger/Getting-Started (right siteaccess and correctly composed URL) instead of: http://ezp54.rui/ger/eng/content/location/61 (two siteaccesses and incorrectly composed URL) which is what is expected, much alike the behaviour of a language switcher. However, using ez_route, from an eng siteaccess , like: <p>{{ url( ez_route( locationObject, {"language": language} ) ) }}</p> I always get: http://ezp54.rui/eng/Getting-Started Is this expected behaviour of the normal usage of ez_route? Should this situation (if deemed abnormal / unexpected) be considered a different issue from this?
          Hide
          Rui Silva (Inactive) added a comment -

          Tested and approved by QA for 5.3 for consistency, and for 5.4 and master.
          Closing since no feedback was provided for last question.
          Feel free to reopen this jira or otherwise open a new one for the question on the previous comment.

          Show
          Rui Silva (Inactive) added a comment - Tested and approved by QA for 5.3 for consistency, and for 5.4 and master. Closing since no feedback was provided for last question. Feel free to reopen this jira or otherwise open a new one for the question on the previous comment.

            People

            • Assignee:
              Unassigned
              Reporter:
              Sebastian Blank
            • 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 - 30 minutes
                30m