mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-07 01:54:22 +00:00
[DS-899] Last modified timestamp doesn't trigger on bitstream delete bugfix
git-svn-id: http://scm.dspace.org/svn/repo/dspace/trunk@6887 9c30dcfa-912a-0410-8fc2-9e0234be79fd
This commit is contained in:
@@ -491,6 +491,14 @@ public class Bundle extends DSpaceObject
|
||||
|
||||
// Place the bitstream in the list of bitstreams in this bundle
|
||||
bitstreams.add(bitstreamMap.get(bitstreamId));
|
||||
}
|
||||
|
||||
//The order of the bitstreams has changed, ensure that we update the last modified of our item
|
||||
Item owningItem = (Item) getParentObject();
|
||||
if(owningItem != null)
|
||||
{
|
||||
owningItem.updateLastModified();
|
||||
owningItem.update();
|
||||
|
||||
}
|
||||
}
|
||||
@@ -531,7 +539,16 @@ public class Bundle extends DSpaceObject
|
||||
}
|
||||
|
||||
ourContext.addEvent(new Event(Event.REMOVE, Constants.BUNDLE, getID(), Constants.BITSTREAM, b.getID(), String.valueOf(b.getSequenceID())));
|
||||
|
||||
|
||||
//Ensure that the last modified from the item is triggered !
|
||||
Item owningItem = (Item) getParentObject();
|
||||
if(owningItem != null)
|
||||
{
|
||||
owningItem.updateLastModified();
|
||||
owningItem.update();
|
||||
|
||||
}
|
||||
|
||||
// In the event that the bitstream to remove is actually
|
||||
// the primary bitstream, be sure to unset the primary
|
||||
// bitstream.
|
||||
|
@@ -306,6 +306,15 @@ public class Item extends DSpaceObject
|
||||
return myDate;
|
||||
}
|
||||
|
||||
/**
|
||||
* Method that updates the last modified date of the item
|
||||
* The modified boolean will be set to true and the actual date update will occur on item.update().
|
||||
*/
|
||||
void updateLastModified()
|
||||
{
|
||||
modified = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the "is_archived" flag. This is public and only
|
||||
* <code>WorkflowItem.archive()</code> should set this.
|
||||
|
Reference in New Issue
Block a user