[MGNLREST-286] Multivalue Composite Fields Using i18n Are Irretrievable With Rest Language Query Parameters Created: 13/Nov/20  Updated: 18/May/21  Resolved: 17/May/21

Status: Closed
Project: Magnolia REST Framework
Component/s: delivery
Affects Version/s: 2.2.6
Fix Version/s: 2.2.7

Type: Bug Priority: Neutral
Reporter: Julian Nodarse Assignee: Canh Nguyen
Resolution: Fixed Votes: 1
Labels: VN-Analysis, VN-Implementation, headless-team-support
Remaining Estimate: Not Specified
Time Spent: 2d 7h
Original Estimate: Not Specified

Issue Links:
causality
is causing MGNLREST-307 DOC: Receive results for any language... Closed
relation
is related to MGNLREST-287 Unable To Get Secondary Language From... Closed
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
Release notes required:
Yes
Documentation update required:
Yes
Date of First Response:
Epic Link: Support
Sprint: HL & LD 28
Story Points: 3

 Description   

The content for the secondary languages is not returned when using a multivalue composite field. When specifying a language with the "lang" parameter in the rest call, the content for the language specified is not retrieved unless the language matches the fallbackLocale.

Steps To Reproduce

  • Make sure you have i18n enabled on your site
  • Create a simple delivery endpoint to retrieve nodes from pages
  • Create a dialog containing a multivalue composite field with i18n
  • Create some values for this new field for both languages
  • Use rest to retrieve the nodes for this newly created content. Make sure to use language parameters in your query ie.e lang=de , lang=en, lang=all etc. 

Actual Result
You will only receive results for the content using the fallbackLocale that is currently in place. Or if using lang=all. lang=de will not return its respective content.

Expected Result
You will receive results for any language you’ve specified within your query.

Additional Notes
This was tested on 6.2.3 using the config for Magnolia 6 UI

Workaround
use lang=all to retrieve all nodes and parse the response to retrieve the language required. (Not ideal or efficient)



 Comments   
Comment by Christian Bordis [ 22/Feb/21 ]

Hello viet.nguyen,

is there "fixVersion" scheduled for this Bug? 

We did run into this issue in Magnolia v6.2.5 and this will cause a lot extra work.
We need to migrate our JSON parsing classes using lang=all-Workaround.
Our JSON parsing is done with Java using Jackson.

Thank You!

Comment by Canh Nguyen [ 17/May/21 ]

Hi mdrapela, below is Robert's comment on the PR, I think we should update the document for MultiField type.

When having i18n: true on city field, it's not delivered at all with ?lang=de (but it is returned with ?lang=all). After removing it, it works okay.
I guess we could just mention in documentation that in case of multifield, i18n shouldn't be set on the children.

 

Generated at Mon Feb 12 06:58:25 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.