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

AbstractI18nContentSupport wrongly determines locale if fallbackLocale and defaultLocale differ

    XMLWordPrintable

Details

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

    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.

      Checklists

        Acceptance criteria

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                  Created:
                  Updated:
                  Resolved:

                  Checklists

                    Bug DoR
                    Task DoD