From 8b789135cccaa207324c3f9cabdc59cc88aee1a1 Mon Sep 17 00:00:00 2001 From: Thierry Bugier Date: Fri, 19 Jun 2020 10:38:28 +0200 Subject: [PATCH] refactor(issue): make UI more stable if SQL errors ocur in counters computation and debug mode enabled Signed-off-by: Thierry Bugier --- inc/issue.class.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/inc/issue.class.php b/inc/issue.class.php index 314304338..c036222cb 100644 --- a/inc/issue.class.php +++ b/inc/issue.class.php @@ -730,25 +730,29 @@ static function getTicketSummary() { $searchIncoming = Search::getDatas(PluginFormcreatorIssue::class, self::getProcessingCriteria()); - if ($searchIncoming['data']['totalcount'] > 0) { + $status[Ticket::INCOMING] = NOT_AVAILABLE; + if (isset($searchIncoming['data']['totalcount'])) { $status[Ticket::INCOMING] = $searchIncoming['data']['totalcount']; } $searchWaiting = Search::getDatas(PluginFormcreatorIssue::class, self::getWaitingCriteria()); - if ($searchWaiting['data']['totalcount'] > 0) { + $status[Ticket::WAITING] = NOT_AVAILABLE; + if (isset($searchWaiting['data']['totalcount'])) { $status[Ticket::WAITING] = $searchWaiting['data']['totalcount']; } $searchValidate = Search::getDatas(PluginFormcreatorIssue::class, self::getValidateCriteria()); - if ($searchValidate['data']['totalcount'] > 0) { + $status['to_validate'] = NOT_AVAILABLE; + if (isset($searchValidate['data']['totalcount'])) { $status['to_validate'] = $searchValidate['data']['totalcount']; } $searchSolved = Search::getDatas(PluginFormcreatorIssue::class, self::getSolvedCriteria()); - if ($searchSolved['data']['totalcount'] > 0) { + $status[Ticket::SOLVED] = NOT_AVAILABLE; + if (isset($searchSolved['data']['totalcount'])) { $status[Ticket::SOLVED] = $searchSolved['data']['totalcount']; }