[MGNLUI-7022] i18n for switchableField doesn't do fallback Created: 20/Jan/22  Updated: 22/Feb/23  Resolved: 15/Nov/22

Status: Closed
Project: Magnolia UI
Component/s: None
Affects Version/s: 6.2.10
Fix Version/s: None

Type: Bug Priority: Neutral
Reporter: Tomáš Gregovský Assignee: Unassigned
Resolution: Resolved Votes: 2
Labels: i18n
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File Screenshot 2022-01-20 at 11.27.23.png     PNG File image-2022-08-24-14-32-52-781.png     PNG File image-2022-08-24-14-35-58-092.png     PNG File image-2022-08-24-14-36-44-947.png     PNG File image-2022-08-24-14-37-15-043.png    
Issue Links:
Problem/Incident
is caused by MGNLUI-5736 Complex fields with jcrChildNodeProvi... Closed
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: jcrChildNodeProvider creates nodes for unselected subforms
Story Points: 3
Team: Nucleus

 Description   

Steps to reproduce

1. to have a dialog with switchableField with i18n:true, e.g.:

 

mediaType:
  label: "Media"
  $type: switchableField
  i18n: true
  field:
    $type: radioButtonGroupField
    layout: horizontal
    defaultValue: none
    datasource:
      $type: optionListDatasource
      options:
        - name: none
          label: "None"
          value: none
        - name: image
          label: "Only image"
          value: image
        - name: youtube
          label: Youtube
          value: youtube
        - name: twentythree
          label: Twenty Three
          value: twentythree
  itemProvider:
    $type: jcrChildNodeProvider
  forms:
    - name: youtube
      properties:
        youtube:
          label: "Youtube link"
          $type: textField
        thumbnail:
          label: Select thumbnail
          $type: damLinkField
    - name: twentythree
      properties:
        twentythree:
          $type: textField
          label: "TwentyThree link"
        thumbnail:
          label: Select thumbnail
          $type: damLinkField
    - name: image
      properties:
        image:
          label: Select image
          $type: damLinkField 

 

2. use this dialog to enter some content for mediaType field (e.g. select image in 

radioButtonGroupField and then select image from dam)

3. use this dialogue again, but switch to edit in another language - do not enter anything into 'mediaType' for selected language, just save it without any edits. 

 

What happens:

Magnolia will save empty nodes for each language variant:

Expected results

If only selected option and provided image is for default language variant, I would expect this being displayed also when previewing the page in any other language.  

Unfortunately this is not the case, there is no image in other language variants (probably because empty nodes vor each language variant exists)

 



 Comments   
Comment by Michael Schneider [ 24/Aug/22 ]

Additional input:

This bug also includes the link targets in our components. In the default English version, it looks fine. If there are no link targets picked in the other languages, it took the default EN targets. But that is not the case anymore and super annoying:

 

Example:

EN

 

DE - German

 

--> Not link buttons in the Hero component are being displayed in the DE version

 

EN

 

DE

 

 

Comment by Michael Schneider [ 04/Oct/22 ]

As discussed with dmaslanka 

https://www.loom.com/share/dcda56895d6e44a8af6821f3dfa7559e

About the blocker scale, I would say it's a solid 8, since I need to manually add those links in not just one but in total of six languages, with is super annoying.

Comment by Adam Siska [ 04/Oct/22 ]

Since 6.2.14 (MGNLUI-6905) only subnodes for selected languages are created. Does it make the issue obsolete then? Or should we investigate more the use case even for one selected and not used/filled language variant?

Comment by Michael Schneider [ 04/Oct/22 ]

HI asiska ,

for me, the following use case would be best:

  • EN content as default (if there is nothing in the dialog fields of the other language variants, the English language is the default)
  • If a language variant dialog field is used, the dialog field gives precedence to the language version

I cannot keep the current state where I need to fill out the same dialog field up to 4-6x because the regional language dialog field is empty and therefore the asset or the link is not being displayed (doesn´t take on the default languages English if empty)

Thanks

Comment by Adam Siska [ 07/Oct/22 ]

Discovery

  • this issue has clear root cause in MGNLUI-5736 (though hard to solve, JCR inherent problem)
  • some related issues were resolved by hardcoding/hacking (see e.g. MGNLUI-6990)

There should be possible ad hoc workarounds:

  • try to use different configuration, i.e. currentItemProvider instead of jcrChildNodeProvider
  • implement custom save action with "empty" nodes deletion
  • adapt/tweak ftl layer checks and data retrieving
Comment by Adam Siska [ 18/Oct/22 ]

This issue is superseded and would be fixed by MGNLUI-5736 (already estimated, could/should be tackled in next sprint)

Comment by Dominik Maslanka [ 15/Nov/22 ]

Closing this issue as the problem gets resolved with MGNLUI-5736 

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