From 99a66a4b4bb71ea97b061197083ca5b94d0ed2a7 Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Tue, 31 Jul 2018 12:59:49 +0200 Subject: [PATCH] Remove node before recreating it upon edit Else you may run into errors that objects have been defined twice. --- application/forms/EditNodeForm.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/application/forms/EditNodeForm.php b/application/forms/EditNodeForm.php index 41e71c9..8ac4a52 100644 --- a/application/forms/EditNodeForm.php +++ b/application/forms/EditNodeForm.php @@ -443,6 +443,9 @@ class EditNodeForm extends QuickForm public function onSuccess() { $changes = ProcessChanges::construct($this->bp, $this->session); + + $changes->deleteNode($this->node, $this->parent->getName()); + switch ($this->getValue('node_type')) { case 'host': case 'service': @@ -459,8 +462,6 @@ class EditNodeForm extends QuickForm break; } - $changes->deleteNode($this->node, $this->parent->getName()); - // Trigger session destruction to make sure it get's stored. // TODO: figure out why this is necessary, might be an unclean shutdown on redirect unset($changes);