fix #5607: laoding of parentnode with propertyPaths solves the problem
authorKatja Luther <k.luther@bgbm.org>
Mon, 29 Aug 2016 10:40:54 +0000 (12:40 +0200)
committerKatja Luther <k.luther@bgbm.org>
Mon, 29 Aug 2016 10:40:54 +0000 (12:40 +0200)
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/newWizard/NewTaxonNodeWizard.java

index 36da706729679f99cbcb4f4bc78d6e4ea587cb8b..63ce08f213b54ef45d411fc156f17b8667b10d50 100644 (file)
@@ -3,7 +3,9 @@
  */
 package eu.etaxonomy.taxeditor.newWizard;
 
+import java.util.ArrayList;
 import java.util.HashSet;
+import java.util.List;
 import java.util.Set;
 import java.util.UUID;
 
@@ -14,6 +16,7 @@ import eu.etaxonomy.cdm.api.application.CdmChangeEvent;
 import eu.etaxonomy.cdm.api.application.CdmChangeEvent.Action;
 import eu.etaxonomy.cdm.api.service.IClassificationService;
 import eu.etaxonomy.cdm.api.service.ITaxonNodeService;
+import eu.etaxonomy.cdm.api.service.ITaxonService;
 import eu.etaxonomy.cdm.api.service.UpdateResult;
 import eu.etaxonomy.cdm.model.common.CdmBase;
 import eu.etaxonomy.cdm.model.reference.Reference;
@@ -116,7 +119,12 @@ public class NewTaxonNodeWizard extends AbstractNewEntityWizard<ITaxonTreeNode>{
                     return CdmStore.getService(IClassificationService.class).load(treeNode.getUuid());
                 }
                 else if(treeNode instanceof TaxonNode){
-                    return CdmStore.getService(ITaxonNodeService.class).load(treeNode.getUuid());
+                       List<String> propertyPaths = new ArrayList<String>();
+                       propertyPaths.add("taxon");
+                       propertyPaths.add("taxon.sec");
+                       TaxonNode node =  CdmStore.getService(ITaxonNodeService.class).load(treeNode.getUuid(), propertyPaths);
+                       //Taxon taxon = (Taxon) CdmStore.getService(ITaxonService.class).load(node.getTaxon().getUuid());
+                    return node;
                 }
             }
         }