Uploaded image for project: 'translate5'
  1. translate5
  2. TRANSLATE-2797

Definition is not addable on language level due wrong default datatype

    XMLWordPrintable

Details

    • Critical
    • In some special cases the collected term attribute types and labels were overwriting some default labels. This so overwritten labels could then not be edited any more in the GUI.

    Description

      problem

      Transline has an issue, where they can't set the "Definition"-attribute on language level.

      The cause of that is, that the data in the terms_attributes_datatype table is wrong.

      Check the two examples:

      https://transline.translate5.net/editor/termportal#termportal/search/WyJNZXNzd2VydCIsIjQiLCIiLCIiLCIiLCIiLCIiLCIiLCIiLCIiLCIiLCIiLCIiLCIiLCIiLCIiLCIiXQ==/NzEwNDc=

      https://transline.translate5.net/editor/termportal#termportal/search/WyIqIiwiNCIsIiIsIiIsIiIsIiIsIiIsIiIsIiIsIiIsIiIsIiIsIiIsIiIsIiIsIiIsIiJd/NjE0NDY=

      => Found reason:

      for some reason the in {{ `terms_attributes_datatype`}} the attribute with the id 6 has a wrong label and wrong type. The label should be descrip and the type should be "definition", like it is in other installations.

      Question is, what did corrupt the data here. Does it originate from the migration, than we simply could write a clean-up script for all translate5 instances. Or does it originate from something in the import, where some data overwrites some stuff, that it should not.

      reason

      The datatype for the descrip definition element was erroneously overwritten on an import. This was finally the reason why definition attribute could not be added anymore.

      solution

      There were at least three smaller bugs, which were in combination causing this problem if no datatype was given. Since the causing TBX was not in the system anymore, the error had to be reverse engineered. As reason an descrip element with empty type could be identified, followed by a termNote with a not registered datatype:

      <termEntry>
          <descripGrp>
              <descrip>a definition without type</descrip>
          </descripGrp>
          <langSet xml:lang='de-DE'>
          <tig>          
              <term>Test</term>
              <termNote type='Usage status'>A new Status not added before</termNote>
          </tig>
          <tig>          
              <term>Test2</term>                    
          </tig>
          </langSet>
      </termEntry>
      

      The errors to be fixed are: Empty / missing type attributes like on the descrip element were not handled properly, so the first descrip element was loaded. On the next attribute handling the previously loaded datatype was not reset, so it was overwritten then. An additionally discovered error was regarding the level calculation of new attributes on language level. They were added to the entry level instead. All those problems are fixed.

      Attachments

        Activity

          People

            tlauria Thomas Lauria
            marcmittag Marc Mittag [Administrator]
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: