ref #8136: fix handling if status is set to null
authorKatja Luther <k.luther@bgbm.org>
Mon, 8 Apr 2019 11:46:41 +0000 (13:46 +0200)
committerKatja Luther <k.luther@bgbm.org>
Mon, 8 Apr 2019 11:46:41 +0000 (13:46 +0200)
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/NameTypeDesignationElement.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/name/SpecimenTypeDesignationElement.java

index 6de23505952927aafd5d382825f97f7ed7131af1..3f10dd3348a644d3c4a8da3f78b513e5d3163f97 100644 (file)
@@ -87,8 +87,14 @@ public class NameTypeDesignationElement extends
                } else if (eventSource == selection_typeName) {
                        getEntity().setTypeName(selection_typeName.getEntity());
                } else if (eventSource == combo_typeStatus) {
-                   if (entity.getTypeStatus() != null && getEntity().getTypeStatus().isLectotype() && !combo_typeStatus.getSelection().isLectotype() && entity.getCitation() != null){
-                boolean ok = MessagingUtils.confirmDialog(Messages.NameTypeDesignationElement_4, Messages.NameTypeDesignationElement_5);
+                   if ((combo_typeStatus.getSelection() == null && entity.getCitation() != null)){
+                       boolean ok = MessagingUtils.confirmDialog(Messages.NameTypeDesignationElement_4, Messages.NameTypeDesignationElement_5);
+                if (!ok){
+                    combo_typeStatus.setSelection(entity.getTypeStatus());
+                    return;
+                }
+                   }else if ( entity.getTypeStatus() != null && getEntity().getTypeStatus().isLectotype() && !combo_typeStatus.getSelection().isLectotype() && entity.getCitation() != null){
+                       boolean ok = MessagingUtils.confirmDialog(Messages.NameTypeDesignationElement_4, Messages.NameTypeDesignationElement_5);
                 if (!ok){
                     combo_typeStatus.setSelection(entity.getTypeStatus());
                     return;
index a2b034fd75c88fb1aea6684cd97cf22ac577a864..874b26fb391e3250ae65dd73506bb73ecf819b6e 100644 (file)
@@ -81,7 +81,7 @@ public class SpecimenTypeDesignationElement extends
            super.handleEvent(eventSource);
                if (eventSource == combo_typeStatus) {
 
-                   if (entity.getTypeStatus() != null && getEntity().getTypeStatus().isLectotype() && !combo_typeStatus.getSelection().isLectotype() && entity.getCitation() != null){
+                   if ((combo_typeStatus.getSelection() == null && entity.getCitation() != null) || ( entity.getTypeStatus() != null && getEntity().getTypeStatus().isLectotype() && !combo_typeStatus.getSelection().isLectotype() && entity.getCitation() != null)){
                        boolean ok = MessagingUtils.confirmDialog(Messages.NameTypeDesignationElement_4, Messages.NameTypeDesignationElement_5);
                        if (!ok){
                            combo_typeStatus.setSelection(entity.getTypeStatus());