From d7eca82de9f47b12e84011fb3394af3d1e096831 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 14 Sep 2016 10:09:04 +0300 Subject: [PATCH] Fix document upload --- app/Libraries/HistoryUtils.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/app/Libraries/HistoryUtils.php b/app/Libraries/HistoryUtils.php index 8c4266a2e0..27566625ca 100644 --- a/app/Libraries/HistoryUtils.php +++ b/app/Libraries/HistoryUtils.php @@ -60,10 +60,16 @@ class HistoryUtils public static function trackViewed(EntityModel $entity) { - if ($entity->isEntityType(ENTITY_CREDIT) - || $entity->isEntityType(ENTITY_PAYMENT) - || $entity->isEntityType(ENTITY_VENDOR) - || $entity->isEntityType(ENTITY_EXPENSE_CATEGORY)) { + $entityType = $entity->getEntityType(); + $trackedTypes = [ + ENTITY_CLIENT, + ENTITY_INVOICE, + ENTITY_QUOTE, + ENTITY_TASK, + ENTITY_EXPENSE + ]; + + if ( ! in_array($entityType, $trackedTypes)) { return; }