mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-16 14:33:09 +00:00
[DS-3179] Collection admin, edit item no authorization to remove file in JSPUI: Fixing unit tests by ensuring the bundleBitstream link is cleared properly when deleting a bitstream
This commit is contained in:
@@ -247,7 +247,13 @@ public class BitstreamServiceImpl extends DSpaceObjectServiceImpl<Bitstream> imp
|
|||||||
context.addEvent(new Event(Event.DELETE, Constants.BITSTREAM, bitstream.getID(),
|
context.addEvent(new Event(Event.DELETE, Constants.BITSTREAM, bitstream.getID(),
|
||||||
String.valueOf(bitstream.getSequenceID()), getIdentifiers(context, bitstream)));
|
String.valueOf(bitstream.getSequenceID()), getIdentifiers(context, bitstream)));
|
||||||
|
|
||||||
bitstream.getBundles().clear();
|
//Remove our bitstream from all our bundles
|
||||||
|
final List<Bundle> bundles = bitstream.getBundles();
|
||||||
|
for (Bundle bundle : bundles) {
|
||||||
|
bundle.getBitstreams().remove(bitstream);
|
||||||
|
}
|
||||||
|
//Remove all bundles from the bitstream object, clearing the connection in 2 ways
|
||||||
|
bundles.clear();
|
||||||
|
|
||||||
deleteMetadata(context, bitstream);
|
deleteMetadata(context, bitstream);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user