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

language switcher : UrlAliasGenerator generate wrong url when there is no translation

    Details

    • Type: Bug Bug
    • Status: Confirmed
    • Priority: High High
    • Resolution: Unresolved
    • Affects Version/s: 5.3.3, 2014.11, 5.4.2
    • Fix Version/s: None
    • Component/s: Language, Platform stack
    • Labels:

      Description

      In a site with 2 translations (2 siteaccess with different language), I have a language switcher implemented as explained in https://doc.ez.no/display/EZP/Language+Switcher.

      If I am on an article in french that has no english translation and I switch to english siteaccess the urlAlias generated will be wrong : mysite.com/eng/fre/content/location/63

      If we look into https://github.com/ezsystems/ezpublish-kernel/blob/master/eZ/Publish/Core/MVC/Symfony/Routing/Generator/UrlAliasGenerator.php#L74 we see that if there is not translation for the current location if will fallback to the default router. But the default router will generate an url of type fre/content/location/63 and because we ask for a siteaccess change it will result in mysite.com/eng/fre/content/location/63

      Shouldn't this redirect to root location if there is no translation ?

        Activity

        Hide
        André Rømcke added a comment -

        I do not think I agree, but I know JV will have a look so let us see what he says.

        Show
        André Rømcke added a comment - I do not think I agree, but I know JV will have a look so let us see what he says.
        Hide
        Bertrand Dunogier added a comment -

        I'm not sure what, but we should do something.

        After reading the comments, I'd agree that the behaviour that was integrated isn't ideal. But the thing is that it was merged, and we should do something

        Show
        Bertrand Dunogier added a comment - I'm not sure what, but we should do something. After reading the comments, I'd agree that the behaviour that was integrated isn't ideal. But the thing is that it was merged, and we should do something
        Hide
        André Rømcke added a comment - - edited

        We should revert, as said above we need to be able to return false / null to fade out the link, logic to then instead point to root location would then be in the template and not in UrlAliasGenerator.

        But a bit unsure what Joao did here and how it relates to this:
        https://jira.ez.no/browse/EZP-24399
        https://github.com/ezsystems/ezpublish-kernel/pull/1282

        Show
        André Rømcke added a comment - - edited We should revert, as said above we need to be able to return false / null to fade out the link, logic to then instead point to root location would then be in the template and not in UrlAliasGenerator. But a bit unsure what Joao did here and how it relates to this: https://jira.ez.no/browse/EZP-24399 https://github.com/ezsystems/ezpublish-kernel/pull/1282
        Hide
        Bertrand Dunogier added a comment - - edited

        Hmmm, #1282 was already merged, and it contains the revert for this fix, does it not ? In that case, this particular issue can remain open, right ?

        Show
        Bertrand Dunogier added a comment - - edited Hmmm, #1282 was already merged, and it contains the revert for this fix, does it not ? In that case, this particular issue can remain open, right ?
        Show
        André Rømcke added a comment - - edited Reverted by Joao in EZP-24399 : https://github.com/joaoinacio/ezpublish-kernel/commit/ea0237179186c9e8b8f3d0ec19a5e821647af80a

          People

          • Assignee:
            Unassigned
            Reporter:
            Matthieu Sévère
          • Votes:
            1 Vote for this issue
            Watchers:
            8 Start watching this issue

            Dates

            • Created:
              Updated:

              Time Tracking

              Estimated:
              Original Estimate - Not Specified
              Not Specified
              Remaining:
              Remaining Estimate - 0 minutes
              0m
              Logged:
              Time Spent - 35 minutes
              35m