diff --git a/module/VuFind/src/VuFind/AjaxHandler/GetUserTransactions.php b/module/VuFind/src/VuFind/AjaxHandler/GetUserTransactions.php index 6126c7409de373c90d4d39575941979408efc2c0..27e8eabe1a29685f5ac776d8395d5ea5714ad482 100644 --- a/module/VuFind/src/VuFind/AjaxHandler/GetUserTransactions.php +++ b/module/VuFind/src/VuFind/AjaxHandler/GetUserTransactions.php @@ -64,15 +64,16 @@ class GetUserTransactions extends AbstractIlsAndUserAction 'overdue' => 0 ]; foreach ($items['records'] as $item) { - if (!isset($item['dueStatus'])) { - continue; - } - if ($item['dueStatus'] == 'overdue') { - $counts['overdue'] += 1; - } elseif ($item['dueStatus'] == 'due') { - $counts['warn'] += 1; - } else { - $counts['ok'] += 1; + switch ($item['dueStatus'] ?? '') { + case 'due': + $counts['warn']++; + break; + case 'overdue': + $counts['overdue']++; + break; + default: + $counts['ok']++; + break; } } return $this->formatResponse($counts);