mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-18 15:33:09 +00:00
[DS-1363] Unable to create new version when previous version was deleted in workspace
This commit is contained in:
@@ -504,15 +504,24 @@ public class VersionedHandleIdentifierProvider extends IdentifierProvider {
|
|||||||
{
|
{
|
||||||
// add a new Identifier for previous item: 12345/100.1
|
// add a new Identifier for previous item: 12345/100.1
|
||||||
String identifierPreviousItem=canonical + DOT + 1;
|
String identifierPreviousItem=canonical + DOT + 1;
|
||||||
|
//Make sure that this hasn't happened already
|
||||||
|
if(findHandleInternal(context, identifierPreviousItem) == null)
|
||||||
|
{
|
||||||
TableRow handle = DatabaseManager.create(context, "Handle");
|
TableRow handle = DatabaseManager.create(context, "Handle");
|
||||||
modifyHandleRecord(context, previous.getItem(), handle, identifierPreviousItem);
|
modifyHandleRecord(context, previous.getItem(), handle, identifierPreviousItem);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// add a new Identifier for this item: 12345/100.x
|
// add a new Identifier for this item: 12345/100.x
|
||||||
String idNew = canonical + DOT + version.getVersionNumber();
|
String idNew = canonical + DOT + version.getVersionNumber();
|
||||||
TableRow handle = DatabaseManager.create(context, "Handle");
|
//Make sure we don't have an old handle hanging around (if our previous version was deleted in the workspace)
|
||||||
modifyHandleRecord(context, dso, handle, idNew);
|
TableRow handleRow = findHandleInternal(context, idNew);
|
||||||
|
if(handleRow == null)
|
||||||
|
{
|
||||||
|
handleRow = DatabaseManager.create(context, "Handle");
|
||||||
|
}
|
||||||
|
modifyHandleRecord(context, dso, handleRow, idNew);
|
||||||
|
|
||||||
return handleId;
|
return handleId;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user