mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-16 06:23:10 +00:00
Adds check for whether source and target collections are the same when moving an item. (#8055)
This commit is contained in:
@@ -911,6 +911,12 @@ public class ItemServiceImpl extends DSpaceObjectServiceImpl<Item> implements It
|
||||
@Override
|
||||
public void move(Context context, Item item, Collection from, Collection to)
|
||||
throws SQLException, AuthorizeException, IOException {
|
||||
|
||||
// If the two collections are the same, do nothing.
|
||||
if (from.equals(to)) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Use the normal move method, and default to not inherit permissions
|
||||
this.move(context, item, from, to, false);
|
||||
}
|
||||
|
Reference in New Issue
Block a user