Skip to content

Commit

Permalink
refactor(issue): make UI more stable
Browse files Browse the repository at this point in the history
if SQL errors ocur in counters computation and debug mode enabled

Signed-off-by: Thierry Bugier <tbugier@teclib.com>
  • Loading branch information
btry committed Jun 19, 2020
1 parent 941e2bb commit 8b78913
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions inc/issue.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'];
}

Expand Down

0 comments on commit 8b78913

Please sign in to comment.