[CONTEDIT-500] locales country part is not taken into account when resolving jcr blocks by locale Created: 10/Jan/23  Updated: 19/Mar/23  Resolved: 07/Mar/23

Status: Closed
Project: Content Editor
Component/s: None
Affects Version/s: None
Fix Version/s: 2.2.0, 2.1.4

Type: Bug Priority: Critical
Reporter: Riste Drangovski Assignee: Oanh Thai Hoang
Resolution: Fixed Votes: 0
Labels: None
Σ Remaining Estimate: 0d Remaining Estimate: 0d
Σ Time Spent: 5h 5m Time Spent: 5h 5m
Σ Original Estimate: Not Specified Original Estimate: Not Specified

Attachments: PNG File Screenshot 2023-01-10 at 12.33.35.png    
Sub-Tasks:
Key
Summary
Type
Status
Assignee
CONTEDIT-501 Implementation Sub-task Closed Oanh Thai Hoang  
CONTEDIT-502 Review Sub-task Closed Lam Nguyen Bao  
CONTEDIT-503 Pre-Integration QA Sub-task Closed Lam Nguyen Bao  
CONTEDIT-504 QA Sub-task Closed Lam Nguyen Bao  
Template:
Acceptance criteria:
Empty
Task DoD:
[X]* Doc/release notes changes? Comment present?
[X]* Downstream builds green?
[X]* Solution information and context easily available?
[X]* Tests
[X]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[X]* Steps to reproduce, expected, and actual results filled
[X]* Affected version filled
Date of First Response:
Epic Link: AuthorX Support
Story Points: 2
Team: AuthorX
Work Started:

 Description   

in method info.magnolia.editor.block.jcr.MultiJcrBlockEntryResolution#getBlocksByLocale

only language part of locale is taken into account when filtering nodes. If we are using locale with country part set, filtering doesn't work properly.

boolean matchSubLocale = StringUtils.endsWith(name, "_" + locale.getLanguage());
I guess we should change this line with something like:
boolean matchSubLocale = StringUtils.endsWith(name, "_" + locale.toString());

module version 2.1.3

Steps to reproduce:

  • Update language from site to DE e.g: /travel/i18n/locales/de@language 
  • Edit a story > switch language to german > click on Copy blocks from English  > provide value for required fields -> save
    Expected results:
  • Has block values for both languages
    Actual result:
  • There's no value when switching to for German

Generated at Mon Feb 12 00:21:02 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.