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
1 changed files with 3 additions and 1 deletions

View File

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