From 71f92a54451554983bbd42934a7c7a6bd771a133 Mon Sep 17 00:00:00 2001 From: Gregory Chalenko Date: Mon, 12 Oct 2020 12:55:45 +0300 Subject: ..F....... [ZBXNEXT-710] fixed filter unsaved state on multiselect data changes between database data and user posted data; added filter_reset for monitoring host --- ui/app/controllers/CControllerHost.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'ui/app/controllers/CControllerHost.php') diff --git a/ui/app/controllers/CControllerHost.php b/ui/app/controllers/CControllerHost.php index ac7020047c2..398163d2e0d 100644 --- a/ui/app/controllers/CControllerHost.php +++ b/ui/app/controllers/CControllerHost.php @@ -296,6 +296,10 @@ abstract class CControllerHost extends CController { * @return array */ protected function cleanInput(array $input): array { + if (array_key_exists('filter_reset', $input) && $input['filter_reset']) { + return array_intersect_key(['filter_name' => ''], $input); + } + if (array_key_exists('tags', $input) && $input['tags']) { $input['tags'] = array_filter($input['tags'], function($tag) { return !($tag['tag'] === '' && $tag['value'] === ''); @@ -303,8 +307,6 @@ abstract class CControllerHost extends CController { $input['tags'] = array_values($input['tags']); } - $input += ['severities' => []]; - return $input; } } -- cgit v1.2.3