diff --git a/library/Businessprocess/Web/Form/Validator/HostServiceTermValidator.php b/library/Businessprocess/Web/Form/Validator/HostServiceTermValidator.php index 58249f73..a9db89e9 100644 --- a/library/Businessprocess/Web/Form/Validator/HostServiceTermValidator.php +++ b/library/Businessprocess/Web/Form/Validator/HostServiceTermValidator.php @@ -45,7 +45,8 @@ public function isValid($terms) } $isValid = true; - $testConfig = new BpConfig(); + $testConfig = (new BpConfig()) + ->setBackend($this->parent->getBpConfig()->getBackend()); foreach ($terms as $term) { /** @var Term $term */ @@ -68,7 +69,7 @@ public function isValid($terms) } } - if ($this->parent->getBpConfig()->getBackend() instanceof MonitoringBackend) { + if ($testConfig->getBackend() instanceof MonitoringBackend) { MonitoringState::apply($testConfig); } else { IcingaDbState::apply($testConfig);