mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-14 21:43:11 +00:00
[DS-197] Deleting a primary bitstream does not clear the primary_bitstream_id on the bundle table
git-svn-id: http://scm.dspace.org/svn/repo/dspace/trunk@4088 9c30dcfa-912a-0410-8fc2-9e0234be79fd
This commit is contained in:
@@ -493,18 +493,19 @@ public class Bundle extends DSpaceObject
|
||||
{
|
||||
// We've found the bitstream to remove
|
||||
li.remove();
|
||||
|
||||
// In the event that the bitstream to remove is actually
|
||||
// the primary bitstream, be sure to unset the primary
|
||||
// bitstream.
|
||||
if (b.getID() == getPrimaryBitstreamID()) {
|
||||
unsetPrimaryBitstreamID();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ourContext.addEvent(new Event(Event.REMOVE, Constants.BUNDLE, getID(), Constants.BITSTREAM, b.getID(), String.valueOf(b.getSequenceID())));
|
||||
|
||||
|
||||
// In the event that the bitstream to remove is actually
|
||||
// the primary bitstream, be sure to unset the primary
|
||||
// bitstream.
|
||||
if (b.getID() == getPrimaryBitstreamID())
|
||||
{
|
||||
unsetPrimaryBitstreamID();
|
||||
}
|
||||
|
||||
// Delete the mapping row
|
||||
DatabaseManager.updateQuery(ourContext,
|
||||
"DELETE FROM bundle2bitstream WHERE bundle_id= ? "+
|
||||
|
Reference in New Issue
Block a user