Merge pull request #3617 from Icinga/fix/contacts-hostgroup-filter

Fix SQL error in contact list when filtering for hostgroups
This commit is contained in:
Eric Lippmann 2018-11-19 17:25:38 +01:00 committed by GitHub
commit a2697d9497
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -121,6 +121,8 @@ class HostcontactQuery extends IdoQuery
*/ */
protected function joinHostgroups() protected function joinHostgroups()
{ {
$this->requireVirtualTable('hosts');
$this->select->joinLeft( $this->select->joinLeft(
['hgm' => $this->prefix . 'hostgroup_members'], ['hgm' => $this->prefix . 'hostgroup_members'],
'hgm.host_object_id = ho.object_id', 'hgm.host_object_id = ho.object_id',
@ -194,7 +196,7 @@ class HostcontactQuery extends IdoQuery
*/ */
protected function joinServices() protected function joinServices()
{ {
$this->joinHosts(); $this->requireVirtualTable('hosts');
$this->select->joinLeft( $this->select->joinLeft(
['s' => $this->prefix . 'services'], ['s' => $this->prefix . 'services'],