From 645141bff3ab465d621e11e90fcd0c8b30169e99 Mon Sep 17 00:00:00 2001 From: KevinVdV Date: Thu, 24 Jan 2013 22:50:42 +0100 Subject: [PATCH] [DS-1416] NPE when removing roles from Collection workflow steps --- .../administrative/FlowContainerUtils.java | 31 ++++++++++--------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/dspace-xmlui/src/main/java/org/dspace/app/xmlui/aspect/administrative/FlowContainerUtils.java b/dspace-xmlui/src/main/java/org/dspace/app/xmlui/aspect/administrative/FlowContainerUtils.java index 395dabcd99..33f4b6407e 100644 --- a/dspace-xmlui/src/main/java/org/dspace/app/xmlui/aspect/administrative/FlowContainerUtils.java +++ b/dspace-xmlui/src/main/java/org/dspace/app/xmlui/aspect/administrative/FlowContainerUtils.java @@ -535,21 +535,24 @@ public class FlowContainerUtils collection.removeSubmitters(); } else{ - WorkflowUtils.deleteRoleGroup(context, collection, roleName); + if(ConfigurationManager.getProperty("workflow", "workflow.framework").equals("xmlworkflow")) + { + WorkflowUtils.deleteRoleGroup(context, collection, roleName); + }else{ + if (ROLE_WF_STEP1.equals(roleName)) + { + collection.setWorkflowGroup(1, null); + } + else if (ROLE_WF_STEP2.equals(roleName)) + { + collection.setWorkflowGroup(2, null); + } + else if (ROLE_WF_STEP3.equals(roleName)) + { + collection.setWorkflowGroup(3, null); + } + } } -// else if (ROLE_WF_STEP1.equals(roleName)) -// { -// collection.setWorkflowGroup(1, null); -// } -// else if (ROLE_WF_STEP2.equals(roleName)) -// { -// collection.setWorkflowGroup(2, null); -// } -// else if (ROLE_WF_STEP3.equals(roleName)) -// { -// collection.setWorkflowGroup(3, null); -// -// } // Second, remove all authorizations for this role by searching for all policies that this // group has on the collection and remove them otherwise the delete will fail because