From 382e615f02d90c015f139e122733dfb995572c14 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Wed, 18 May 2016 21:25:57 +0200 Subject: [PATCH] KickstartHelper: allow to modify existing objects --- library/Director/KickstartHelper.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/library/Director/KickstartHelper.php b/library/Director/KickstartHelper.php index 55377636..b3a56ee7 100644 --- a/library/Director/KickstartHelper.php +++ b/library/Director/KickstartHelper.php @@ -277,9 +277,13 @@ class KickstartHelper { $db = $this->db; foreach ($this->api()->setDb($db)->getCheckCommandObjects() as $object) { - if (! $object::exists($object->object_name, $db)) { - $object->store(); + if ($object::exists($object->object_name, $db)) { + $new = $object::load($object->object_name, $db)->replaceWith($object); + } else { + $new = $object; } + + $new->store(); } return $this;