Fix Sybunt to select mark rows as selected
authoreileen <emcnaughton@wikimedia.org>
Sun, 17 Nov 2019 07:04:26 +0000 (20:04 +1300)
committereileen <emcnaughton@wikimedia.org>
Sun, 17 Nov 2019 07:04:26 +0000 (20:04 +1300)
CRM/Contact/Form/Search/Custom/ContribSYBNT.php
CRM/Contact/Selector.php

index 3263889090055a134e4af9898b2f4428d024afd9..dd8ae5e66ed10e210f255ba0bf4c6a2a0e781753 100644 (file)
@@ -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;
   }
index 4fd277c6ffff561995aa0f685d5b17b0cf0fb116..1e9a3b0ee5a54dfe3f2ed9d3a161dc2877485025 100644 (file)
@@ -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.