diff --git a/app/Libraries/HistoryUtils.php b/app/Libraries/HistoryUtils.php index 6bad2156b3eb..79da4fb162d3 100644 --- a/app/Libraries/HistoryUtils.php +++ b/app/Libraries/HistoryUtils.php @@ -72,8 +72,9 @@ class HistoryUtils $lastClientId = false; $clientMap = []; $str = ''; + $history = Session::get(RECENTLY_VIEWED, []); - foreach (Session::get(RECENTLY_VIEWED) as $item) + foreach ($history as $item) { if ($item->entityType == ENTITY_CLIENT && isset($clientMap[$item->client_id])) { continue;