mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-18 23:43:06 +00:00
unset primary bitstream on bitstream service
This commit is contained in:
@@ -276,6 +276,10 @@ public class BitstreamServiceImpl extends DSpaceObjectServiceImpl<Bitstream> imp
|
|||||||
//Remove our bitstream from all our bundles
|
//Remove our bitstream from all our bundles
|
||||||
final List<Bundle> bundles = bitstream.getBundles();
|
final List<Bundle> bundles = bitstream.getBundles();
|
||||||
for (Bundle bundle : bundles) {
|
for (Bundle bundle : bundles) {
|
||||||
|
//We also need to remove the bitstream id when it's set as bundle's primary bitstream
|
||||||
|
if(bitstream.equals(bundle.getPrimaryBitstream())) {
|
||||||
|
bundle.unsetPrimaryBitstreamID();
|
||||||
|
}
|
||||||
bundle.removeBitstream(bitstream);
|
bundle.removeBitstream(bitstream);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user