From cc722578b62441fd3064766ae1b5c0dbd997645b Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Thu, 8 Sep 2016 16:19:57 +0000 Subject: [PATCH] IcingaServiceForm: fix null modification --- application/forms/IcingaServiceForm.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/application/forms/IcingaServiceForm.php b/application/forms/IcingaServiceForm.php index b31b3bcd..42f0162b 100644 --- a/application/forms/IcingaServiceForm.php +++ b/application/forms/IcingaServiceForm.php @@ -141,6 +141,11 @@ class IcingaServiceForm extends DirectorObjectForm $this->addHidden('object_type', 'object'); $this->addImportsElement(); $imports = $this->getSentOrObjectValue('imports'); + + if ($this->hasBeenSent()) { + $imports = $this->getElement('imports')->setValue($imports)->getValue(); + } + if ($this->isNew() && empty($imports)) { return $this->groupMainProperties(); } @@ -153,7 +158,7 @@ class IcingaServiceForm extends DirectorObjectForm ->setButtons(); if ($this->hasBeenSent()) { - $name = $this->getValue('object_name'); + $name = $this->getSentOrObjectValue('object_name'); if (!strlen($name)) { $this->setElementValue('object_name', end($imports)); $this->object->object_name = end($imports);