ServicestatusQuery: Respect an already set group clause

refs 
This commit is contained in:
Johannes Meyer 2015-08-12 13:40:17 +02:00
parent 5ae5b5e8d3
commit dc7d3a9c92
1 changed files with 8 additions and 2 deletions
modules/monitoring/library/Monitoring/Backend/Ido/Query

View File

@ -362,9 +362,15 @@ class ServicestatusQuery extends IdoQuery
*/
public function getGroup()
{
$group = array();
$group = parent::getGroup() ?: array();
if (! is_array($group)) {
$group = array($group);
}
if ($this->hasJoinedVirtualTable('hostgroups') || $this->hasJoinedVirtualTable('servicegroups')) {
$group = array('s.service_id', 'so.object_id');
$group[] = 's.service_id';
$group[] = 'so.object_id';
if ($this->hasJoinedVirtualTable('hosts')) {
$group[] = 'h.host_id';
}