From aa8ff3474d99b06498c40c453b07f058083d6c34 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Thomas=20Sch=C3=BCttler?= Date: Thu, 11 Jan 2018 13:56:59 +0100 Subject: [PATCH] CRM-21651 - Activity_Email/SMS_Add - Fix loading failed when no contact is found --- CRM/Contact/Page/AJAX.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/CRM/Contact/Page/AJAX.php b/CRM/Contact/Page/AJAX.php index cfdff39d0f..6f9123fac6 100644 --- a/CRM/Contact/Page/AJAX.php +++ b/CRM/Contact/Page/AJAX.php @@ -388,6 +388,7 @@ class CRM_Contact_Page_AJAX { } if ($queryString) { + $result = array(); $offset = CRM_Utils_Array::value('offset', $_GET, 0); $rowCount = Civi::settings()->get('search_autocomplete_count'); @@ -450,9 +451,7 @@ LIMIT {$offset}, {$rowCount} ); } } - if ($result) { - CRM_Utils_JSON::output($result); - } + CRM_Utils_JSON::output($result); } } CRM_Utils_System::civiExit(); @@ -483,6 +482,7 @@ LIMIT {$offset}, {$rowCount} } if ($queryString) { + $result = array(); $offset = CRM_Utils_Array::value('offset', $_GET, 0); $rowCount = CRM_Utils_Array::value('rowcount', $_GET, 20); @@ -519,9 +519,6 @@ LIMIT {$offset}, {$rowCount} 'id' => (CRM_Utils_Array::value('id', $_GET)) ? "{$dao->id}::{$dao->phone}" : '"' . $dao->name . '" <' . $dao->phone . '>', ); } - } - - if ($result) { CRM_Utils_JSON::output($result); } CRM_Utils_System::civiExit(); -- 2.25.1