ref #10034: check dirty nodes at the beginning of move operation.
authorKatja Luther <k.luther@bgbm.org>
Wed, 1 Jun 2022 07:08:34 +0000 (09:08 +0200)
committerKatja Luther <k.luther@bgbm.org>
Wed, 1 Jun 2022 07:09:30 +0000 (09:09 +0200)
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/termtree/e4/TermTreeDtoDropAdapter.java

index 806d70b2fca4b43dd29b172c294264d49869ee23..cdea483890653a0c3706fc76b24c7d1da278217c 100755 (executable)
@@ -68,12 +68,16 @@ public class TermTreeDtoDropAdapter extends ViewerDropAdapter {
                else if(currentTarget instanceof TermNodeDto){
                    target = (TermNodeDto) currentTarget;
                }
-
+               
                int position = 0;
                int location = getCurrentLocation();
                UUID parentUuid = target.getParentUuid();
                if(parentUuid!=null){
                    TermNodeDto parent = editor.getNodeDtoForUuid(parentUuid);
+                   if (parent == null){
+                   MessagingUtils.warningDialog("The new node needs to be saved first", this, "Newly created nodes can not be moved or used as parent without saving");
+                   return false;
+               }
                    if (location == LOCATION_BEFORE) {
                        position = Math.max(0, parent.getIndex(target));
                        target = parent;