From dcb44c9b45003134318b92f8c8cffbbdea408351 Mon Sep 17 00:00:00 2001 From: eileen Date: Sun, 17 Nov 2019 20:04:26 +1300 Subject: [PATCH] Fix Sybunt to select mark rows as selected --- CRM/Contact/Form/Search/Custom/ContribSYBNT.php | 2 +- CRM/Contact/Selector.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CRM/Contact/Form/Search/Custom/ContribSYBNT.php b/CRM/Contact/Form/Search/Custom/ContribSYBNT.php index 3263889090..dd8ae5e66e 100644 --- a/CRM/Contact/Form/Search/Custom/ContribSYBNT.php +++ b/CRM/Contact/Form/Search/Custom/ContribSYBNT.php @@ -193,7 +193,7 @@ ORDER BY donation_amount desc if ($justIDs) { $tempTable = CRM_Utils_SQL_TempTable::build()->createWithQuery($sql); - $sql = "SELECT contact_a.id as contact_id FROM {$tempTable->getName()} as contact_a"; + $sql = "SELECT contact_a.id as contact_id FROM {$tempTable->getName()} c INNER JOIN civicrm_contact contact_a ON c.id = contact_a.id"; } return $sql; } diff --git a/CRM/Contact/Selector.php b/CRM/Contact/Selector.php index 4fd277c6ff..1e9a3b0ee5 100644 --- a/CRM/Contact/Selector.php +++ b/CRM/Contact/Selector.php @@ -1052,6 +1052,7 @@ class CRM_Contact_Selector extends CRM_Core_Selector_Base implements CRM_Core_Se $this->rebuildPreNextCache($start, $end, $sort, $cacheKey); } else { + CRM_Core_Error::deprecatedFunctionWarning('Custom searches should return sql capable of filling the prevnext cache.'); // This will always show for CiviRules :-( as a) it orders by 'rule_label' // which is not available in the query & b) it uses contact not contact_a // as an alias. -- 2.25.1