Uploaded image for project: 'Content Translation Extended (CTX)'
  1. Content Translation Extended (CTX)
  2. EXCONTRANS-312

i18nFields contain fields from subnodes, despite not including them - NPE on download

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Outdated
    • Icon: Neutral Neutral
    • 3.0.1
    • 2.0.3
    • None
    • Magnolia 5.6.X
      Translations Adapter 2.0.3

      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

        Acceptance criteria

              tmiyar Teresa Miyar
              soberhuber Sascha Oberhuber
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Bug DoR
                  Task DoD