TermDTOs with an orderIndex are ordered in unordered term vocabularies
To reproduce this behavior:
- Open the term editor for states.
- Move a term to the "State" vocabulary (Must be from an unordered vocabulary). "State" is an ordered term vocabulary.
- Move the term back to its original vocabulary -> The term is added to the last position
This happens because the orderIndex is set to 1 from the move to the "State" vocabulary.
Sorting is done in eu.etaxonomy.taxeditor.editor.definedterm.DefinedTermSorter.
Add the class type of the term/vocabulary to the DTO to distinguish between sorting by label and sorting by orderIndex-
#2 Updated by Andreas Müller 10 days ago
This generally should not be possible!!
An OrderedTerm must NEVER be moved to an unordered vocabulary. AND currently "State" are ordered terms therefore their vocabularies must ALWAYS be OrderedTermVocabularies!
If this is not implemented in such a way in TaxEditor or in imports it needs to be changed. Unfortunately cdmlib does not seem to force it.
However, in future this will change. All vocabularies will be saved in an ordered way but if order is relevant will be defined by a flag in the vocabulary (same for term collections like term trees). But until then we need to handle this correctly.