From 8ccae742717ece1c047d157ec9e06e4594993f93 Mon Sep 17 00:00:00 2001
From: aydreeihn <adriane@enhancesoft.com>
Date: Thu, 19 Apr 2018 09:53:56 -0500
Subject: [PATCH] This fix uses 'filter' instead of 'findFirst' for finding
 Dept and Team referrals since the __in operator is not included in the
 evaluate function that was being called when using 'findFirst'

---
 include/class.thread.php | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/class.thread.php b/include/class.thread.php
index b5176ada2..017d7db35 100644
--- a/include/class.thread.php
+++ b/include/class.thread.php
@@ -299,12 +299,12 @@ implements Searchable {
                 return false;
 
             // Referred to staff's department
-            if ($to->getDepts() && $this->referrals->findFirst(array(
+            if ($to->getDepts() && $this->referrals->filter(array(
                             'object_id__in' => $to->getDepts(),
                             'object_type'   => ObjectModel::OBJECT_TYPE_DEPT)))
                 return true;
             // Referred to staff's  team
-            if ($to->getTeams() && $this->referrals->findFirst(array(
+            if ($to->getTeams() && $this->referrals->filter(array(
                             'object_id__in' => $to->getTeams(),
                             'object_type'   => ObjectModel::OBJECT_TYPE_TEAM)))
                 return true;
-- 
GitLab