OverriddenVarsResolver: deal with root templates

fixes #2333
This commit is contained in:
Thomas Gelf 2021-05-28 10:36:31 +02:00
parent 2cff396fe4
commit ec87cd0ec2
2 changed files with 5 additions and 1 deletions

View File

@ -26,6 +26,7 @@ next (will be 1.9.0)
* FIX: allow switching DB config while connection is failing (#2300)
* FIX: show Override button when all Fields belong to Field Categories (#2303)
* FIX: show Services applied with Rules involving applied Hostgroups (#2313)
* FIX: Overrides for Services belonging to Sets on root Host Templates (#2333)
* FEATURE: show "deprecated" flag on object attribute inspection (#2312)
* FEATURE: Service Template for single Host services provides auto-completion (#1974)

View File

@ -22,7 +22,11 @@ class OverriddenVarsResolver
public function fetchForHost(IcingaHost $host)
{
$overrides = [];
$parents = $host->listFlatResolvedImportNames();
if (empty($parents)) {
return $overrides;
}
$query = $this->db->select()
->from(['hv' => 'icinga_host_var'], [
'host_name' => 'h.object_name',
@ -36,7 +40,6 @@ class OverriddenVarsResolver
->where('hv.varname = ?', $this->overrideVarName)
->where('h.object_name IN (?)', $parents);
$overrides = [];
foreach ($this->db->fetchAll($query) as $row) {
if ($row->varvalue === null) {
continue;