mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-08 10:34:25 +00:00
[DS-694] Fix writing of modification information to Item
git-svn-id: http://scm.dspace.org/svn/repo/dspace/trunk@5488 9c30dcfa-912a-0410-8fc2-9e0234be79fd
This commit is contained in:
@@ -1718,39 +1718,33 @@ public class Item extends DSpaceObject
|
|||||||
modified = true;
|
modified = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dublinCoreChanged || modified)
|
|
||||||
{
|
|
||||||
// Set the last modified date
|
|
||||||
itemRow.setColumn("last_modified", new Date());
|
|
||||||
|
|
||||||
// Make sure that withdrawn and in_archive are non-null
|
|
||||||
if (itemRow.isColumnNull("in_archive"))
|
|
||||||
{
|
|
||||||
itemRow.setColumn("in_archive", false);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (itemRow.isColumnNull("withdrawn"))
|
|
||||||
{
|
|
||||||
itemRow.setColumn("withdrawn", false);
|
|
||||||
}
|
|
||||||
|
|
||||||
DatabaseManager.update(ourContext, itemRow);
|
|
||||||
|
|
||||||
if (dublinCoreChanged)
|
|
||||||
{
|
|
||||||
ourContext.addEvent(new Event(Event.MODIFY_METADATA, Constants.ITEM, getID(), getDetails()));
|
|
||||||
clearDetails();
|
|
||||||
dublinCoreChanged = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
ourContext.addEvent(new Event(Event.MODIFY, Constants.ITEM, getID(), null));
|
|
||||||
modified = false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (modified)
|
if (dublinCoreChanged || modified)
|
||||||
{
|
{
|
||||||
|
// Set the last modified date
|
||||||
|
itemRow.setColumn("last_modified", new Date());
|
||||||
|
|
||||||
|
// Make sure that withdrawn and in_archive are non-null
|
||||||
|
if (itemRow.isColumnNull("in_archive"))
|
||||||
|
{
|
||||||
|
itemRow.setColumn("in_archive", false);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (itemRow.isColumnNull("withdrawn"))
|
||||||
|
{
|
||||||
|
itemRow.setColumn("withdrawn", false);
|
||||||
|
}
|
||||||
|
|
||||||
|
DatabaseManager.update(ourContext, itemRow);
|
||||||
|
|
||||||
|
if (dublinCoreChanged)
|
||||||
|
{
|
||||||
|
ourContext.addEvent(new Event(Event.MODIFY_METADATA, Constants.ITEM, getID(), getDetails()));
|
||||||
|
clearDetails();
|
||||||
|
dublinCoreChanged = false;
|
||||||
|
}
|
||||||
|
|
||||||
ourContext.addEvent(new Event(Event.MODIFY, Constants.ITEM, getID(), null));
|
ourContext.addEvent(new Event(Event.MODIFY, Constants.ITEM, getID(), null));
|
||||||
modified = false;
|
modified = false;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user