diff --git a/modules/monitoring/application/views/scripts/show/components/contacts.phtml b/modules/monitoring/application/views/scripts/show/components/contacts.phtml index 641efb597..5661c1a3e 100644 --- a/modules/monitoring/application/views/scripts/show/components/contacts.phtml +++ b/modules/monitoring/application/views/scripts/show/components/contacts.phtml @@ -1,6 +1,6 @@ contacts)) { +if ($object->contacts->hasResult()) { $list = array(); foreach ($object->contacts as $contact) { @@ -17,10 +17,9 @@ if (! empty($object->contacts)) { $this->translate('Contacts'), implode(', ', $list) ); - } -if (! empty($object->contactgroups)) { +if ($object->contactgroups->hasResult()) { $list = array(); foreach ($object->contactgroups as $contactgroup) { $list[] = $this->qlink( @@ -36,6 +35,4 @@ if (! empty($object->contactgroups)) { $this->translate('Contactgroups'), implode(', ', $list) ); - } - diff --git a/modules/monitoring/library/Monitoring/Object/MonitoredObject.php b/modules/monitoring/library/Monitoring/Object/MonitoredObject.php index 5fff8721c..4a787d309 100644 --- a/modules/monitoring/library/Monitoring/Object/MonitoredObject.php +++ b/modules/monitoring/library/Monitoring/Object/MonitoredObject.php @@ -389,7 +389,7 @@ abstract class MonitoredObject implements Filterable } else { $contactsGroups->where('host_name', $this->host_name); } - $this->contactgroups = $contactsGroups->applyFilter($this->getFilter())->getQuery()->fetchAll(); + $this->contactgroups = $contactsGroups; return $this; } @@ -418,7 +418,7 @@ abstract class MonitoredObject implements Filterable } else { $contacts->where('host_name', $this->host_name); } - $this->contacts = $contacts->applyFilter($this->getFilter())->getQuery()->fetchAll(); + $this->contacts = $contacts; return $this; } @@ -596,7 +596,7 @@ abstract class MonitoredObject implements Filterable $eventHistory->where('service_description', $this->service_description); } - $this->eventhistory = $eventHistory->applyFilter($this->getFilter()); + $this->eventhistory = $eventHistory; return $this; }