From 6ec810cf5ea20fdca0e6a6867ea0a59e7c18c965 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Thu, 14 Jun 2018 20:52:56 -0700 Subject: [PATCH] (dev/core#183) Change temp table naming for CRM/Contact/Form/Search/Custom/ContribSYBNT.php Re:`r-run` -- Verified that these lines are executed by the search form -- and that the outcomes of a few basic searches are the same with the patch. --- CRM/Contact/Form/Search/Custom/ContribSYBNT.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/CRM/Contact/Form/Search/Custom/ContribSYBNT.php b/CRM/Contact/Form/Search/Custom/ContribSYBNT.php index bfd961b1c2..cf2b1e950b 100644 --- a/CRM/Contact/Form/Search/Custom/ContribSYBNT.php +++ b/CRM/Contact/Form/Search/Custom/ContribSYBNT.php @@ -192,10 +192,8 @@ ORDER BY donation_amount desc "; if ($justIDs) { - CRM_Core_DAO::executeQuery("DROP TEMPORARY TABLE IF EXISTS CustomSearch_SYBNT_temp"); - $query = "CREATE TEMPORARY TABLE CustomSearch_SYBNT_temp AS ({$sql})"; - CRM_Core_DAO::executeQuery($query); - $sql = "SELECT contact_a.id as contact_id FROM CustomSearch_SYBNT_temp as contact_a"; + $tempTable = CRM_Utils_SQL_TempTable::build()->createWithQuery($sql); + $sql = "SELECT contact_a.id as contact_id FROM {$tempTable->getName()} as contact_a"; } return $sql; } -- 2.25.1