ItemService.move(Context, Item, Collection, Collection, boolean) should have a check if the item is moved into a collection it already belongs to. In such a case DSpace tries to add the item to the collection, but notices that it belongs to this collection already and doesn't add it a second time. Then it tries to remove the item from the old collection. If an item is removed from a collection, DSpace checks first, if it belongs to one collection only and deletes the item in that case. It does not check if the item belongs to the collection it shall be removed from. We should add checks if an item is moved into a collection it already belongs to and ignore the move action in that case. Before an item is removed from a collection we should not check only if the item belongs to one collection only. We should check if it belongs to the collection it shall be removed from at all. This sounds like a avoiding a miss-use of the API. I ran into the problem, because a browser send a move order again that was already executed before. In that case DSpace deleted the item. I will prepare a PR against DSpace 6 and 7. |