Uploaded image for project: 'Magnolia'
  1. Magnolia
  2. MAGNOLIA-5940

AbstractI18nContentSupport wrongly determines locale if fallbackLocale and defaultLocale differ

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.4.8
    • Fix Version/s: 5.5.5
    • Component/s: i18n
    • Labels:
    • Sprint:
      Kromeriz 98
    • Story Points:
      8
    • Magnolia Release:
      5.5.5

      Description

      info.magnolia.cms.i18n.AbstractI18nContentSupport#determineLocale() wrongly determines the Locale if fallbackLocale and defaultLocale differ due to:

      // instead of returning the content fallback language
      // we are going to return the default locale which might differ
      if(locale.equals(getFallbackLocale())){
          locale = getDefaultLocale();
      }
      
      Problem

      info.magnolia.cms.i18n.I18nContentSupportFilter uses the above method to determine the current Locale. Consider the following scenario:

      • defaultLocale: de
      • fallbackLocale: en
      • URL: /demo-project/en

      When accessing the en page, the method will return de, as en is fallbackLocale but de is defaultLocale, thus the I18nContentSupportFilter will try to find a page named /en which doesn't exists → 404.

      Proposed solution

      Completely remove above logic.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              efochr Evzen Fochr
              Reporter:
              pmundt Philip Mundt
              Votes:
              2 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Date of First Response: