From 7cd89490cc2d031ceda01c70675c2173abc2b019 Mon Sep 17 00:00:00 2001 From: Sukhwinder Dhillon Date: Wed, 16 Aug 2023 10:35:48 +0200 Subject: [PATCH] (EventOverview/StateHistory)Form: Method `getValue()` expects only one param --- .../monitoring/application/forms/EventOverviewForm.php | 10 +++++----- .../monitoring/application/forms/StatehistoryForm.php | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/modules/monitoring/application/forms/EventOverviewForm.php b/modules/monitoring/application/forms/EventOverviewForm.php index db1511ce6..78774f95a 100644 --- a/modules/monitoring/application/forms/EventOverviewForm.php +++ b/modules/monitoring/application/forms/EventOverviewForm.php @@ -97,19 +97,19 @@ class EventOverviewForm extends Form public function getFilter() { $filters = array(); - if ($this->getValue('statechange', 1)) { + if ($this->getValue('statechange')) { $filters[] = $this->stateChangeFilter(); } - if ($this->getValue('comment', 1)) { + if ($this->getValue('comment')) { $filters[] = $this->commentFilter(); } - if ($this->getValue('notification', 1)) { + if ($this->getValue('notification')) { $filters[] = $this->notificationFilter(); } - if ($this->getValue('downtime', 1)) { + if ($this->getValue('downtime')) { $filters[] = $this->downtimeFilter(); } - if ($this->getValue('flapping', 1)) { + if ($this->getValue('flapping')) { $filters[] = $this->flappingFilter(); } return Filter::matchAny($filters); diff --git a/modules/monitoring/application/forms/StatehistoryForm.php b/modules/monitoring/application/forms/StatehistoryForm.php index 3a7c10df5..c28e39ca8 100644 --- a/modules/monitoring/application/forms/StatehistoryForm.php +++ b/modules/monitoring/application/forms/StatehistoryForm.php @@ -31,7 +31,7 @@ class StatehistoryForm extends Form Filter::expression('type', '=', 'hard_state') ); - if ($this->getValue('objecttype', 'hosts') === 'hosts') { + if ($this->getValue('objecttype') === 'hosts') { $objectTypeFilter = Filter::expression('object_type', '=', 'host'); } else { $objectTypeFilter = Filter::expression('object_type', '=', 'service'); @@ -46,7 +46,7 @@ class StatehistoryForm extends Form 'cnt_unknown_hard' => Filter::expression('state', '=', '3'), 'cnt_ok' => Filter::expression('state', '=', '0') ); - $state = $this->getValue('state', 'cnt_critical_hard'); + $state = $this->getValue('state'); $stateFilter = $states[$state]; if (in_array($state, array('cnt_ok', 'cnt_up'))) { return Filter::matchAll($objectTypeFilter, $stateFilter);