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

AbstractI18nContentSupport wrongly determines locale if fallbackLocale and defaultLocale differ

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 5.5.5
    • 5.4.8
    • i18n
    • Kromeriz 98
    • 8

      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.

        Acceptance criteria

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

                Created:
                Updated:
                Resolved:

                  Bug DoR
                  Task DoD