[MGNLCTS-130] Partial export of jcrMultiField with subfields of type compositeField Created: 05/Feb/21  Updated: 18/Dec/22  Resolved: 29/Nov/22

Status: Closed
Project: Content Translation Support
Component/s: None
Affects Version/s: None
Fix Version/s: 2.5.9

Type: Bug Priority: Neutral
Reporter: Federico Grilli Assignee: Lam Nguyen Bao
Resolution: Fixed Votes: 0
Labels: VN-Analysis, VN-Implementation, VN-Testing, cs-bk
Σ Remaining Estimate: 0d Remaining Estimate: 0d
Σ Time Spent: 6d 5.25h Time Spent: 6d 5.25h
Σ Original Estimate: Not Specified Original Estimate: Not Specified

Attachments: PNG File i18n-field.png     PNG File image-2022-11-07-14-04-48-427.png     PNG File image-2022-11-07-14-22-23-823.png     PNG File image-2022-11-07-16-28-52-598.png     Zip Archive multi-field-with-compostie.zip     PNG File translation-app-config.png    
Issue Links:
relation
is related to MGNLCTS-126 Support for complex fields Closed
Sub-Tasks:
Key
Summary
Type
Status
Assignee
MGNLCTS-171 Port to master Sub-task Closed Lam Nguyen Bao  
MGNLCTS-172 QA Sub-task Completed Miguel Martinez  
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
Sprint: AuthX 22
Story Points: 3
Team: AuthorX

 Description   

A follow up to MGNLCTS-126.

See comments starting at https://jira.magnolia-cms.com/browse/MGNLCTS-126?focusedCommentId=249341&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-249341
for more context, steps to reproduce and a workaround.



 Comments   
Comment by Thuy To [ 07/Nov/22 ]

Hi ldelnevo,

After discovery, I think there is no fixing in code, we will update and take some notes for document in cafe of jcrMultiField with subfields of type compositeField.

For configuration to export jcrMultiField in Content Translation Support :

+ Add the jcrMultiField type of exported content is configured in /modules/translation/config/supportedFieldDefinitions as image below:

 

+ Definition in dialog example:

   Notes: Only using the itemProvider configuration for jcrMultiField.

   

cc: abrooks 

Comment by Richard Gange [ 10/Nov/22 ]

Hello thuy.to-

I was looking into this a bit today. I'm having a little trouble understanding what the issue is. Please forgive me as I am a little late to the party. I have not been involved on any of the support tickets. Bobcat pinged me regarding the issue so that is how I became involved.

Anywhoo... When I read the docs for the Multi field it seems to me we have a couple of i18n scenarios to think about here. In the docs I see the following message for the i18n field:

Your example in the comment above would be the unique set of entries scenario so I started there. I have created a light module multi-field-with-compostie.zip

My dialog looks like this:
/multi-field-with-compostie/dialogs/unique-set-multi.yaml

form:
  properties:
    multi:
      label: Multi Field
      $type: jcrMultiField
      i18n: false
      itemProvider:
        $type: currentItemProvider
      field:
        label: Composite Field
        $type: compositeField
        properties:
          text1:
            label: Text 1
            $type: textField
            i18n: true
          text2:
            label: Text 2
            $type: textField
            i18n: true

My configuration for the translation app is set like this:

Now if I use a currentItemProvider configuration the data ends up looking like this:

content:
  0:
    multi0:
      text1: Text 1 en
      text1_de: Text 1 de
      text2: Text 2 en
      text2_de: Text 2 de

If I export to CSV I get this:

"Modification date of page","Key","Link to page","Title","Default language (en)","de"
"2022.11.10 24:09:54 618","76b42503-591a-4e26-9181-3dc8330bb526:multi0/text1.i18n.","http://localhost:8080/magnoliaAuthor/fallback/home/multi-page.html","Unique Set Multi Example: Text 1","Text 1 en","Text 1 de"
"2022.11.10 24:09:54 618","76b42503-591a-4e26-9181-3dc8330bb526:multi0/text2.i18n.","http://localhost:8080/magnoliaAuthor/fallback/home/multi-page.html","Unique Set Multi Example: Text 2","Text 2 en","Text 2 de"

OTOH if I remove the itemProvider configuration the data saves like this:

content:
  0:
    multi:
      multi0:
        text1: Text 1 en
        text1_de: Text 1 de
        text2: Text 2 en
        text2_de: Text 2 de

If I export to CSV I get this:

"Modification date of page","Key","Link to page","Title","Default language (en)","de"
"2022.11.10 01:15:16 439","c6863d8f-4f7e-466e-98ca-dcb1f63396cf:multi/multi0/text1.i18n.","http://localhost:8080/magnoliaAuthor/fallback/home/multi-page.html","Unique Set Multi Example: Text 1","Text 1 en","Text 1 de"
"2022.11.10 01:15:16 439","c6863d8f-4f7e-466e-98ca-dcb1f63396cf:multi/multi0/text2.i18n.","http://localhost:8080/magnoliaAuthor/fallback/home/multi-page.html","Unique Set Multi Example: Text 2","Text 2 en","Text 2 de"

It seems to me the item provider config doesn't impact the export. All fields making it to the export. So I am not quite sure what the problem is here.

Comment by Lam Nguyen Bao [ 11/Nov/22 ]

rgange 

IMO, it's true that item provider should not make any impact on exporting (perhaps it does with other kinds of itemProvider than default). Since, if we remove any kind of itemProvider then the default will be used and as I remember correctly currentItemProvider is the default of composite field (it works fine). So it's same as currentItemProvider is specifically use 

I will double check again

Comment by Richard Gange [ 11/Nov/22 ]

Ok. The reason I brought up the item provider is because it was mentioned in the first comment as well as the conversation on the other ticket. I'm still trying to figure out what this ticket is about. The title indicates multi field with composites (which I have) but it's still not clear to me what the bug is. What configuration breaks the export?

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