[EXCONTRANS-312] i18nFields contain fields from subnodes, despite not including them - NPE on download Created: 18/Dec/18  Updated: 24/Mar/20  Resolved: 18/Dec/19

Status: Resolved
Project: Content Translation Extended (CTX)
Component/s: Translations.com Translator
Affects Version/s: 2.0.3
Fix Version/s: 3.0.1

Type: Bug Priority: Neutral
Reporter: Sascha Oberhuber Assignee: Teresa Miyar
Resolution: Outdated Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Magnolia 5.6.X
Translations Adapter 2.0.3


Attachments: XML File config.modules.products-app.xml     Text File log_excerpt.txt     XML File products.B2C-Produkte.fill-and-enjoy.BRITA-fill-enjoy-Marella.BRITA-fill-enjoy-Marella-Cool-(2..4-l)-blue_translationTest_v2.xml     XML File translationQueues.OPEN.1545125034282.xml    
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:

 Description   

Hi all,Hi all,
back to testing, ran into new issues.

The scenario for this first one is as follows:I have a content app, and add a node from that content app to a batch. I only add a single node, "include subnodes" is disabled in the dialogue. I choose a few random target languages that are known to work.
I submit the batch via the app, without activating the scheduled job to transmit it. This allows me to take a closer look at the batch without interference.

The xliff on each mgnl:translationSubmission node looks fine; It contains a correct reference to the node I added to the batch, as well as the correct number of trans-units.
However, the mgnl:translationSubmission node also contains a content node called "i18nFields", and this node contains references to both the node I selected, as well as every subnode's i18 fields.

Note that in this context, the i18n-enabled text field properties carry the same name as the one in the parent node ("displayName").
As the generated xliff is correct, it exports to translations.com fine, and can be translated as usual. However, the download fails with a null pointer exception. 

From what I gather from the logs and reading the code, the error happens in SetTranslationCommand:
(Note: decompiled)

 

private void setTranslatedI18nItem(List<I18nItem> i18nFields, NodeList elementsByTagName) {
    for(int i = 0; i < i18nFields.size(); ++i) {
        I18nItem i18nItem = (I18nItem)i18nFields.get(i);
        i18nItem.setTranslatedValue(this.getTranslatedValueFromNode(elementsByTagName.item(i)));
    }
}

 

This seems to expect just as many trans-unit elements in the xliff as there are subnodes in i18nFields. But they don't match, as i18Fields also contains values from the subnodes.
I am not yet sure whether i18nFields always contains all fields from the subnodes, or whether there is more to it.

Attachments:

  • export of the content app from the config workspace
  • export of the content item I added to the batch
  • export of one of the translationQueues entries that correspond to the error
  • excerpt form the logs


 Comments   
Comment by Teresa Miyar [ 18/Dec/19 ]

Issue not present on 3.0.1

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