This commit is contained in:
Nikolaos Laskaris 2017-11-08 10:31:03 +02:00
parent a7b251ed04
commit 503cf583dd
1 changed files with 5 additions and 1 deletions

View File

@ -303,6 +303,7 @@ public class DMPs {
DMP clone = dMPDao.read(dmp.getId()); DMP clone = dMPDao.read(dmp.getId());
try { try {
Set<UserInfo> users = new HashSet<UserInfo>(); Set<UserInfo> users = new HashSet<UserInfo>();
@ -313,8 +314,11 @@ public class DMPs {
clone.setModified(new Date()); clone.setModified(new Date());
clone.setStatus(new Short("0")); clone.setStatus(new Short("0"));
String cloneLabel = dmp.getLabel();
if(cloneLabel==null || cloneLabel.isEmpty()) //if the provided label is null or empty, use parent's label + "_clone"
cloneLabel = clone.getLabel()+"_clone";
clone.setVersion(clone.getVersion()+1); clone.setVersion(clone.getVersion()+1);
clone.setLabel(clone.getLabel()+"_clone"); clone.setLabel(cloneLabel);
clone.setPrevious(clone.getId()); clone.setPrevious(clone.getId());