mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-29 16:54:06 +02:00
IcingaServiceForm: fix "blacklist" for overrides
...when defined being such via Sync rule
This commit is contained in:
parent
ee230cb865
commit
bd5ad64f02
@ -51,6 +51,10 @@ class IcingaServiceForm extends DirectorObjectForm
|
||||
*/
|
||||
public function setup()
|
||||
{
|
||||
if (!$this->isNew() || $this->providesOverrides()) {
|
||||
$this->tryToFetchHost();
|
||||
}
|
||||
|
||||
if ($this->providesOverrides()) {
|
||||
return;
|
||||
}
|
||||
@ -60,14 +64,6 @@ class IcingaServiceForm extends DirectorObjectForm
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
if (!$this->isNew() && $this->host === null) {
|
||||
$this->host = $this->object->getResolvedRelated('host');
|
||||
}
|
||||
} catch (NestingError $nestingError) {
|
||||
// ignore for the form to load
|
||||
}
|
||||
|
||||
if ($this->set !== null) {
|
||||
$this->setupSetRelatedElements();
|
||||
} elseif ($this->host === null) {
|
||||
@ -77,6 +73,17 @@ class IcingaServiceForm extends DirectorObjectForm
|
||||
}
|
||||
}
|
||||
|
||||
protected function tryToFetchHost()
|
||||
{
|
||||
try {
|
||||
if ($this->host === null) {
|
||||
$this->host = $this->object->getResolvedRelated('host');
|
||||
}
|
||||
} catch (NestingError $nestingError) {
|
||||
// ignore for the form to load
|
||||
}
|
||||
}
|
||||
|
||||
protected function providesOverrides()
|
||||
{
|
||||
return $this->applyGenerated
|
||||
|
Loading…
x
Reference in New Issue
Block a user