Director rollback in case of existing object during live-creation
This commit is contained in:
parent
b1c29c16d0
commit
407ccddc2f
|
@ -124,7 +124,8 @@ class ObjectCommand extends Command
|
|||
if ($this->api()->createObjectAtRuntime($object)) {
|
||||
echo "Live creation for '$name' succeeded\n";
|
||||
} else {
|
||||
echo "Live creation for '$name' succeeded\n";
|
||||
echo "Live creation for '$name' failed\n";
|
||||
$object->delete();
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
|
|
@ -314,10 +314,11 @@ class CoreApi implements DeploymentApiInterface
|
|||
$key = $object->getShortTableName();
|
||||
|
||||
$command = sprintf(
|
||||
"f = function() {\n"
|
||||
. ' existing = get_%s("%s")'
|
||||
. "\n if (existing) { return false }"
|
||||
. "\n%s\n}\nInternal.run_with_activation_context(f)\n",
|
||||
'existing = get_%s("%s")'
|
||||
. "\nf = function() {\n"
|
||||
. "%s\n}\n"
|
||||
. "if (existing) { false } else {\n"
|
||||
. "Internal.run_with_activation_context(f)\n}\n",
|
||||
$key,
|
||||
$object->get('object_name'),
|
||||
(string) $object
|
||||
|
|
Loading…
Reference in New Issue