diff options
author | Gregory Chalenko <gregory.chalenko@zabbix.com> | 2020-10-08 09:52:51 +0300 |
---|---|---|
committer | Gregory Chalenko <gregory.chalenko@zabbix.com> | 2020-10-08 09:52:51 +0300 |
commit | 662ffacfbdaca79a1b9a6cb2d1b5f7b60c37b918 (patch) | |
tree | 614c81b5a9997a7abb84190848c4106ba70012e6 | |
parent | 0074a545f492edbfbfde0b318773e1030773a302 (diff) |
..F....... [ZBXNEXT-710] api fail to return correct results when in parameters there is one more api call
-rw-r--r-- | ui/app/controllers/CControllerHost.php | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/ui/app/controllers/CControllerHost.php b/ui/app/controllers/CControllerHost.php index f2e6fbc645b..f7ed03b47da 100644 --- a/ui/app/controllers/CControllerHost.php +++ b/ui/app/controllers/CControllerHost.php @@ -65,12 +65,14 @@ abstract class CControllerHost extends CController { * @return int */ protected function getCount(array $filter): int { + $groupids = $filter['groupids'] ? getSubGroups($filter['groupids']) : null; + return (int) API::Host()->get([ 'countOutput' => true, 'evaltype' => $filter['evaltype'], 'tags' => $filter['tags'], 'inheritedTags' => true, - 'groupids' => $filter['groupids'] ? getSubGroups($filter['groupids']) : null, + 'groupids' => $groupids, 'severities' => $filter['severities'] ? $filter['severities'] : null, 'withProblemsSuppressed' => $filter['severities'] ? (($filter['show_suppressed'] == ZBX_PROBLEM_SUPPRESSED_TRUE) ? null : false) @@ -114,12 +116,13 @@ abstract class CControllerHost extends CController { */ protected function getData(array $filter): array { $limit = CSettingsHelper::get(CSettingsHelper::SEARCH_LIMIT) + 1; + $groupids = $filter['groupids'] ? getSubGroups($filter['groupids']) : null; $hosts = API::Host()->get([ 'output' => ['hostid', 'name', 'status'], 'evaltype' => $filter['evaltype'], 'tags' => $filter['tags'], 'inheritedTags' => true, - 'groupids' => $filter['groupids'] ? getSubGroups($filter['groupids']) : null, + 'groupids' => $groupids, 'severities' => $filter['severities'] ? $filter['severities'] : null, 'withProblemsSuppressed' => $filter['severities'] ? (($filter['show_suppressed'] == ZBX_PROBLEM_SUPPRESSED_TRUE) ? null : false) |