Skip to content
Snippets Groups Projects
Commit 4f579158 authored by srosse's avatar srosse
Browse files

OO-872: don't delete the lifecycle before the repository entry is updated

parent 64c3306b
No related branches found
No related tags found
No related merge requests found
...@@ -922,12 +922,12 @@ public class RepositoryManager extends BasicManager { ...@@ -922,12 +922,12 @@ public class RepositoryManager extends BasicManager {
} }
reloadedRe.setLifecycle(cycle); reloadedRe.setLifecycle(cycle);
RepositoryEntry updatedRe = DBFactory.getInstance().getCurrentEntityManager().merge(reloadedRe); RepositoryEntry updatedRe = dbInstance.getCurrentEntityManager().merge(reloadedRe);
if(cycleToDelete != null) { if(cycleToDelete != null) {
DBFactory.getInstance().getCurrentEntityManager().remove(cycleToDelete); dbInstance.getCurrentEntityManager().remove(cycleToDelete);
} }
DBFactory.getInstance().commit(); dbInstance.commit();
return updatedRe; return updatedRe;
} }
......
...@@ -388,11 +388,7 @@ public class RepositoryEditDescriptionController extends FormBasicController { ...@@ -388,11 +388,7 @@ public class RepositoryEditDescriptionController extends FormBasicController {
} }
if("none".equals(type)) { if("none".equals(type)) {
RepositoryEntryLifecycle cycle = repositoryEntry.getLifecycle();
repositoryEntry.setLifecycle(null); repositoryEntry.setLifecycle(null);
if(cycle != null && cycle.isPrivateCycle()) {
lifecycleDao.deleteLifecycle(cycle);
}
} else if("public".equals(type)) { } else if("public".equals(type)) {
String key = publicDatesEl.getSelectedKey(); String key = publicDatesEl.getSelectedKey();
if(StringHelper.isLong(key)) { if(StringHelper.isLong(key)) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment