[MAGNOLIA-5940] AbstractI18nContentSupport wrongly determines locale if fallbackLocale and defaultLocale differ Created: 06/Oct/14  Updated: 05/Jun/17  Resolved: 01/Jun/17

Status: Closed
Project: Magnolia
Component/s: i18n
Affects Version/s: 5.4.8
Fix Version/s: 5.5.5

Type: Bug Priority: Major
Reporter: Philip Mundt Assignee: Evzen Fochr
Resolution: Fixed Votes: 2
Labels: support
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Relates
relates to MGNLUI-3128 FormBuilder: defaultLocale in dialogs... Closed
causality
caused by MAGNOLIA-3062 i18n: support multiple languages in e... Closed
is causing MAGNOLIA-6851 Enabled i18n breaks Virtual URI Mappi... Accepted
relation
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:
Sprint: Kromeriz 98
Story Points: 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.



 Comments   
Comment by Roman Kovařík [ 26/May/17 ]

Reopened: reverted due to failing selenium tests

Generated at Mon Feb 12 04:09:50 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.