[
https://jira.duraspace.org/browse/DS-1416?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=27359#comment-27359
]
Peter Dietz commented on DS-1416:
---------------------------------
I've made a dummy collection on the Demo instance:
http://demo.dspace.org/xmlui/admin/collection?collectionID=51 to see this bug
in action, try to go to Assign Roles, and delete the Workflow Step.
Below, the code that hard-codes XML-Workflow.
{code}
else{
WorkflowUtils.deleteRoleGroup(context, collectionID, 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);
//
// }
{code}
Commit at:
https://github.com/DSpace/DSpace/commit/65f5786e9e13336122a71aa9f8ec51898901e541#L46R528
> NPE when removing roles from Collection workflow steps
> ------------------------------------------------------
>
> Key: DS-1416
> URL: https://jira.duraspace.org/browse/DS-1416
> Project: DSpace
> Issue Type: Bug
> Components: DSpace API, XMLUI
> Affects Versions: 3.0
> Reporter: Ian Boston
>
> In the XMLUI
> If I edit a collection
> Add a role to a workflow step clicking create.
> Add a user to that role.
> save
> then delete the role from the workflow step.
> I get the following NPE:
> java.lang.NullPointerException
> at
> org.dspace.xmlworkflow.WorkflowUtils.deleteRoleGroup(WorkflowUtils.java:215)
> at
> org.dspace.app.xmlui.aspect.administrative.FlowContainerUtils.processDeleteCollectionRole(FlowContainerUtils.java:538)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:155)
> at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:243)
> at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:3237)
> The method is:
> public static void deleteRoleGroup(Context context, Collection collection,
> String roleID) throws SQLException, IOException,
> WorkflowConfigurationException {
> Workflow workflow = WorkflowFactory.getWorkflow(collection);
> Role role = workflow.getRoles().get(roleID);
> Line: 215>>>>>>> NPE on role if(role.getScope() ==
> Role.Scope.COLLECTION){
> CollectionRole ass = CollectionRole.find(context,
> collection.getID(), roleID);
> ass.delete();
> }
> }
> You could do
> if ( role != null && role.getScope() ...
> but role should not be null ?
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
------------------------------------------------------------------------------
Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API and
much more. Get web development skills now with LearnDevNow -
350+ hours of step-by-step video tutorials by Microsoft MVPs and experts.
SALE $99.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122812
_______________________________________________
Dspace-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dspace-devel