[MGNLUI-4450] Multivalue composite language dependent fields are not displayed when we "add" a new one in a different language than the default Created: 06/Jun/18  Updated: 05/Aug/21  Resolved: 21/Jul/21

Status: Closed
Project: Magnolia UI
Component/s: dialogs
Affects Version/s: 5.4.15, 5.5.10, 5.6.5
Fix Version/s: None

Type: Bug Priority: Neutral
Reporter: Viet Nguyen Assignee: Mikaël Geljić
Resolution: Cannot Reproduce Votes: 0
Labels: maintenance, tech-debt
Remaining Estimate: 0.5h
Time Spent: 1h
Original Estimate: Not Specified

Attachments: PNG File 4450-i18n-false-01-en.png     PNG File 4450-i18n-false-02-de.png     PNG File 4450-i18n-false-03-reopen-en.png     PNG File 4450-i18n-false-04-structure.png     PNG File 4450-i18n-true-01-en.png     PNG File 4450-i18n-true-02-de.png     PNG File 4450-i18n-true-03-de-filled.png     PNG File 4450-i18n-true-04-reopen-en.png     PNG File 4450-i18n-true-05-structure.png     File MGNLUI-4450-multifield-i18n.yaml     PNG File MultiValueFieldDefinition-i18n.png     PNG File add new value.png     PNG File add one more field in de.png     Text File error.txt     PNG File jcr content still there.png     PNG File nothing display on dialog at multivalue field section.png     PNG File open a dialog and add an en one.png     File promotionConcept_simplified.yaml    
Issue Links:
causality
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:
Epic Link: Support

 Description   

Please reference to original ticket SUPPORT-8744 for more information.
For short 'Multivalue composite language dependent fields are not displayed when we "add" a new one in a different language than the default'. Reproduce steps:

  1. Use attached dialog configuration to have configured i18n supported multivalue composite field.
  2. Open the dialog, switch to DE for instance
  3. Click ADD button to add a new configured field, put some values into it
  4. Switch back to EN to see your added field disappear
  5. Click SAVE button then reopen your dialog to see the empty field appear in English (since it has no content in English but in DE)

Expected result:
Allow switching back and forth on i18n multivalue composite field and save it properly.



 Comments   
Comment by Mikaël Geljić [ 07/Jun/18 ]

viet.nguyen turn i18n to false on the MultiValueFieldDefinition. Setting it to true there means that you want a different set of entries per language.

Comment by Viet Nguyen [ 08/Jun/18 ]

Hello mgeljic,

turn i18n to false on the MultiValueFieldDefinition. Setting it to true there means that you want a different set of entries per language.

--> This's not what this issue mean. The issue is switching back and forth between different languages made the fields disappear on UI. Please try my reproduce steps to get an insight.

This is an issue but not a major one, but closing it as not an issue sound not very logical. Also

Setting it to true there means that you want a different set of entries per language.

--> I would say 'no', otherwise please update our i18n documentation, setting i18n to true means customers would like to have multiple languages on the same data set.

Hope this helps!

Comment by Mikaël Geljić [ 08/Jun/18 ]

Hey viet.nguyen, I did take your steps.

Behavior before closing the dialog (4) vs. after reopening it (5) is consistent.

The i18n setting is not inherited by sub-fields; the proper way is to use it just for the literal text fields where you expect to have translations.
Again, if you want to switch back and forth while preserving the fields, set the multifield i18n to false to achieve exactly this.

Actually, I found another issue with the definition: the name property is also i18n'ed. This is used by the save action for the JCR node name, and our i18n doesn't operate over different nodes. Still this might confuse the transformer while switching languages. Once turned off, the fields stay on screen as expected (4).

--> I would say 'no', otherwise please update our i18n documentation, setting i18n to true means customers would like to have multiple languages on the same data set.

It's not about interpretation here, I'm telling you how it works. That said, I agree with you that Multivalue field documentation lacks a note about this. Feel free to file a DOCU ticket.

Comment by Viet Nguyen [ 11/Jun/18 ]

First of all I've turn i18n on Multi value field to false and change a sub label to 'Select a segment 2' to make sure that the new setting get affected.

Then we open the dialog and add a new multi-value-field with few English content like below

Now switch to DE and add one more promotion field (because we have more promotions in DE than EN)

Click SAVE button then reopen the dialog to double check.
>>> The issue happen here, our content disappear as below:

I've checked JCR content using our JCR browser and see our content still there

>>> Now a higher severity issue happen: We would never able to add any value to our Multivaluefield. Try to add some value to it then click SAVE button cause below error:

Error log:
error.txt
Please have a look and help fixing this issue.

Comment by Mikaël Geljić [ 23/Aug/18 ]

With i18n = false: same set, same count of entries

With i18n = true: different set, different count of entries (since you say "because we have more promotions in DE than EN")

In both cases, I could not reproduce any error, missing field, nor misbehavior.

Mind that if the proper configuration to achieve the desired behavior produces a different structure to that of existing data, you have to upgrade your content accordingly (best via groovy script).

I'm attaching the definition as well MGNLUI-4450-multifield-i18n.yaml.

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