From 9ab51ac67f37c8f0c639298f9587244bfa255966 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Tue, 20 Feb 2018 10:55:38 +0200 Subject: [PATCH] Don't incldue deleted in history --- app/Libraries/HistoryUtils.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/Libraries/HistoryUtils.php b/app/Libraries/HistoryUtils.php index a1394e3d42ea..b9782b6dab9a 100644 --- a/app/Libraries/HistoryUtils.php +++ b/app/Libraries/HistoryUtils.php @@ -13,7 +13,7 @@ class HistoryUtils { $userIds = []; session([RECENTLY_VIEWED => false]); - + if (is_array($users)) { foreach ($users as $user) { $userIds[] = $user->user_id; @@ -96,6 +96,10 @@ class HistoryUtils return; } + if ($entity->is_deleted) { + return; + } + $object = static::convertToObject($entity); $history = Session::get(RECENTLY_VIEWED) ?: []; $accountHistory = isset($history[$entity->account_id]) ? $history[$entity->account_id] : [];