mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-29 00:34:03 +02:00
Merge pull request #3220 from Icinga/fix/filter-by-custom-variables
Fix filter by host custom variables
This commit is contained in:
commit
6abb91421a
@ -964,6 +964,12 @@ abstract class IdoQuery extends DbQuery
|
|||||||
$leftcol = 'h.host_object_id';
|
$leftcol = 'h.host_object_id';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$mapped = $this->getMappedField($leftcol);
|
||||||
|
if ($mapped !== null) {
|
||||||
|
$this->requireColumn($leftcol);
|
||||||
|
$leftcol = $mapped;
|
||||||
|
}
|
||||||
|
|
||||||
$joinOn = sprintf(
|
$joinOn = sprintf(
|
||||||
$this->customVarsJoinTemplate,
|
$this->customVarsJoinTemplate,
|
||||||
$leftcol,
|
$leftcol,
|
||||||
|
@ -18,6 +18,9 @@ class ServicegroupQuery extends IdoQuery
|
|||||||
'hostgroups' => array(
|
'hostgroups' => array(
|
||||||
'hostgroup_name' => 'hgo.name1'
|
'hostgroup_name' => 'hgo.name1'
|
||||||
),
|
),
|
||||||
|
'hosts' => array(
|
||||||
|
'h.host_object_id' => 's.host_object_id'
|
||||||
|
),
|
||||||
'instances' => array(
|
'instances' => array(
|
||||||
'instance_name' => 'i.instance_name'
|
'instance_name' => 'i.instance_name'
|
||||||
),
|
),
|
||||||
@ -70,6 +73,16 @@ class ServicegroupQuery extends IdoQuery
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Join hosts
|
||||||
|
*
|
||||||
|
* This is required to make filters work which filter by host custom variables.
|
||||||
|
*/
|
||||||
|
protected function joinHosts()
|
||||||
|
{
|
||||||
|
$this->requireVirtualTable('services');
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Join instances
|
* Join instances
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user