Uploaded image for project: 'DSpace'
  1. DSpace
  2. DS-3882

Deleting an item does not remove its policies

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Cannot Reproduce
    • Affects Version/s: 6.2, 6.3, 7.0
    • Fix Version/s: None
    • Component/s: API
    • Labels:
      None
    • Environment:
      JSPUI
    • Attachments:
      0
    • Comments:
      1
    • Documentation Status:
      Needed

      Description

      When an item is deleted from DSpace, any policies linked to it are not being removed as well in at least the following cases:

      • A submitter deletes an in-progress submission of his own in "My DSpace".
      • An admin deletes an item in the "Edit Item" form.

      Relevant policies:

      Links to relevant code:

      https://github.com/DSpace/DSpace/blob/dspace-6_x/dspace-jspui/src/main/java/org/dspace/app/webui/servlet/admin/EditItemServlet.java#L275

      https://github.com/DSpace/DSpace/blob/dspace-6_x/dspace-jspui/src/main/java/org/dspace/app/webui/servlet/MyDSpaceServlet.java#L379

      https://github.com/DSpace/DSpace/blob/dspace-6_x/dspace-api/src/main/java/org/dspace/content/WorkspaceItemServiceImpl.java#L190

      In all those places, nothing is done about policies, as it should be. I would expect that to be in ItemServiceImpl.java in rawDelete() ( https://github.com/DSpace/DSpace/blob/dspace-6_x/dspace-api/src/main/java/org/dspace/content/ItemServiceImpl.java#L632 ) ) but I can't see any code taking care of policies there.

      I found this bug by trying to delete a user that had previously started and later deleted at least one submission. The user could not be deleted (interestingly without an internal server error), and the log files showed foreign key constraint violations on the resourcepolicy table.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              pmuench Philip Münch
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: