mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-16 06:23:10 +00:00
Merge pull request #9106 from paulo-graca/bugfix/issue-9099
Clear primary bistream when it's deleted- Fix issue #9099
This commit is contained in:
@@ -276,6 +276,11 @@ public class BitstreamServiceImpl extends DSpaceObjectServiceImpl<Bitstream> imp
|
||||
//Remove our bitstream from all our bundles
|
||||
final List<Bundle> bundles = bitstream.getBundles();
|
||||
for (Bundle bundle : bundles) {
|
||||
authorizeService.authorizeAction(context, bundle, Constants.REMOVE);
|
||||
//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);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user