From 0bdf05e61c3da7f972adab4faba9e967ae7ea591 Mon Sep 17 00:00:00 2001 From: Victor Woeltjen Date: Wed, 10 Feb 2016 13:49:15 -0800 Subject: [PATCH] [Create] Always allow cloning self Always allow cloning the newly-created object itself when saving a newly-created domain object. --- platform/commonUI/edit/src/actions/SaveAction.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/platform/commonUI/edit/src/actions/SaveAction.js b/platform/commonUI/edit/src/actions/SaveAction.js index 21542bb2ad..1415a6ed4b 100644 --- a/platform/commonUI/edit/src/actions/SaveAction.js +++ b/platform/commonUI/edit/src/actions/SaveAction.js @@ -106,12 +106,13 @@ define( return fetchObject(object.getModel().location); } - function isOriginal(domainObject) { - return domainObject.getCapability('location').isOriginal(); + function allowClone(objectToClone) { + return (objectToClone.getId() === domainObject.getId()) || + objectToClone.getCapability('location').isOriginal(); } function cloneIntoParent(parent) { - return copyService.perform(domainObject, parent, isOriginal); + return copyService.perform(domainObject, parent, allowClone); } function cancelEditingAfterClone(clonedObject) {