From 5e5a5c68cc631dedb6c88f1821c3caaa45bb354a Mon Sep 17 00:00:00 2001 From: Marc DeTrano Date: Tue, 14 May 2019 17:17:26 -0600 Subject: [PATCH] Fixes 2266. Special handling of notification 'output' field to avoid using aggregate function in WHERE clause of query...which dumps an error style fixup, exact === usage --- .../Monitoring/Backend/Ido/Query/HostnotificationQuery.php | 2 ++ .../Monitoring/Backend/Ido/Query/ServicenotificationQuery.php | 2 ++ 2 files changed, 4 insertions(+) diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/HostnotificationQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/HostnotificationQuery.php index 38ab9a557..2d875f061 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/HostnotificationQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/HostnotificationQuery.php @@ -68,6 +68,8 @@ class HostnotificationQuery extends IdoQuery { if ($col === 'UNIX_TIMESTAMP(hn.start_time)') { return 'hn.start_time ' . $sign . ' ' . $this->timestampForSql($this->valueToTimestamp($expression)); + } elseif ($col === $this->columnMap['history']['output']) { + return parent::whereToSql('hn.output', $sign, $expression); } else { return parent::whereToSql($col, $sign, $expression); } diff --git a/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServicenotificationQuery.php b/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServicenotificationQuery.php index b98f5e1e7..b9d63f40e 100644 --- a/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServicenotificationQuery.php +++ b/modules/monitoring/library/Monitoring/Backend/Ido/Query/ServicenotificationQuery.php @@ -68,6 +68,8 @@ class ServicenotificationQuery extends IdoQuery { if ($col === 'UNIX_TIMESTAMP(sn.start_time)') { return 'sn.start_time ' . $sign . ' ' . $this->timestampForSql($this->valueToTimestamp($expression)); + } elseif ($col === $this->columnMap['history']['output']) { + return parent::whereToSql('sn.output', $sign, $expression); } else { return parent::whereToSql($col, $sign, $expression); }