diff --git a/application/controllers/HealthController.php b/application/controllers/HealthController.php index bfd1099e1..9259b3c17 100644 --- a/application/controllers/HealthController.php +++ b/application/controllers/HealthController.php @@ -26,8 +26,8 @@ public function indexAction() $db = $this->getDb(); $instance = Instance::on($db)->with('endpoint'); - $hoststateSummary = HoststateSummary::on($db)->with('state'); - $servicestateSummary = ServicestateSummary::on($db)->with('state'); + $hoststateSummary = HoststateSummary::on($db); + $servicestateSummary = ServicestateSummary::on($db); $this->applyRestrictions($hoststateSummary); $this->applyRestrictions($servicestateSummary); diff --git a/application/controllers/HostController.php b/application/controllers/HostController.php index 92da6abb3..9ef3f0ad8 100644 --- a/application/controllers/HostController.php +++ b/application/controllers/HostController.php @@ -63,7 +63,7 @@ public function init() public function indexAction() { - $serviceSummary = ServicestateSummary::on($this->getDb())->with('state'); + $serviceSummary = ServicestateSummary::on($this->getDb()); $serviceSummary->filter(Filter::equal('service.host_id', $this->host->id)); $this->applyRestrictions($serviceSummary); diff --git a/application/controllers/HostsController.php b/application/controllers/HostsController.php index e2493ccf2..b9978268b 100644 --- a/application/controllers/HostsController.php +++ b/application/controllers/HostsController.php @@ -48,7 +48,7 @@ public function indexAction() $summary = null; if (! $compact) { - $summary = HoststateSummary::on($db)->with('state'); + $summary = HoststateSummary::on($db); } $limitControl = $this->createLimitControl(); @@ -226,7 +226,7 @@ protected function getCommandTargetsUrl(): Url protected function getFeatureStatus() { - $summary = HoststateSummary::on($this->getDb())->with(['state']); + $summary = HoststateSummary::on($this->getDb()); $this->filter($summary); return new FeatureStatus('host', $summary->first()); diff --git a/application/controllers/ServicesController.php b/application/controllers/ServicesController.php index 6466612ef..6c0be8a46 100644 --- a/application/controllers/ServicesController.php +++ b/application/controllers/ServicesController.php @@ -53,7 +53,7 @@ public function indexAction() $summary = null; if (! $compact) { - $summary = ServicestateSummary::on($db)->with('state'); + $summary = ServicestateSummary::on($db); } $limitControl = $this->createLimitControl(); @@ -347,7 +347,7 @@ protected function getCommandTargetsUrl(): Url protected function getFeatureStatus() { - $summary = ServicestateSummary::on($this->getDb())->with(['state']); + $summary = ServicestateSummary::on($this->getDb()); $this->filter($summary); return new FeatureStatus('service', $summary->first()); diff --git a/application/controllers/TacticalController.php b/application/controllers/TacticalController.php index 2e1ca7145..0022e0f65 100644 --- a/application/controllers/TacticalController.php +++ b/application/controllers/TacticalController.php @@ -23,8 +23,8 @@ public function indexAction() $db = $this->getDb(); - $hoststateSummary = HoststateSummary::on($db)->with('state'); - $servicestateSummary = ServicestateSummary::on($db)->with(['state']); + $hoststateSummary = HoststateSummary::on($db); + $servicestateSummary = ServicestateSummary::on($db); $this->handleSearchRequest($servicestateSummary); diff --git a/library/Icingadb/Model/HoststateSummary.php b/library/Icingadb/Model/HoststateSummary.php index e544acc59..2696e4db1 100644 --- a/library/Icingadb/Model/HoststateSummary.php +++ b/library/Icingadb/Model/HoststateSummary.php @@ -71,6 +71,7 @@ public static function on(Connection $db) /** @var static $m */ $m = $q->getModel(); $q->columns($m->getSummaryColumns()); + $q->utilize('state'); return $q; } diff --git a/library/Icingadb/Model/ServicestateSummary.php b/library/Icingadb/Model/ServicestateSummary.php index a2209c629..0ce36eef6 100644 --- a/library/Icingadb/Model/ServicestateSummary.php +++ b/library/Icingadb/Model/ServicestateSummary.php @@ -76,6 +76,7 @@ public static function on(Connection $db) /** @var static $m */ $m = $q->getModel(); $q->columns($m->getSummaryColumns()); + $q->utilize('state'); return $q; } diff --git a/library/Icingadb/Web/Navigation/Renderer/HostProblemsBadge.php b/library/Icingadb/Web/Navigation/Renderer/HostProblemsBadge.php index 17f8354e2..fc64c7d73 100644 --- a/library/Icingadb/Web/Navigation/Renderer/HostProblemsBadge.php +++ b/library/Icingadb/Web/Navigation/Renderer/HostProblemsBadge.php @@ -15,7 +15,7 @@ class HostProblemsBadge extends ProblemsBadge protected function fetchProblemsCount() { - $summary = HoststateSummary::on($this->getDb())->with('state'); + $summary = HoststateSummary::on($this->getDb()); $this->applyRestrictions($summary); $count = (int) $summary->first()->hosts_down_unhandled; if ($count) { diff --git a/library/Icingadb/Web/Navigation/Renderer/ServiceProblemsBadge.php b/library/Icingadb/Web/Navigation/Renderer/ServiceProblemsBadge.php index ef60f990b..b2f2cae0d 100644 --- a/library/Icingadb/Web/Navigation/Renderer/ServiceProblemsBadge.php +++ b/library/Icingadb/Web/Navigation/Renderer/ServiceProblemsBadge.php @@ -15,7 +15,7 @@ class ServiceProblemsBadge extends ProblemsBadge protected function fetchProblemsCount() { - $summary = ServicestateSummary::on($this->getDb())->with('state'); + $summary = ServicestateSummary::on($this->getDb()); $this->applyRestrictions($summary); $count = (int) $summary->first()->services_critical_unhandled; if ($count) {