dev/core#2861 Saved search loading fix
authorEileen McNaughton <emcnaughton@wikimedia.org>
Fri, 24 Sep 2021 19:35:30 +0000 (07:35 +1200)
committerEileen McNaughton <emcnaughton@wikimedia.org>
Fri, 24 Sep 2021 23:53:34 +0000 (11:53 +1200)
CRM/Contact/BAO/GroupContactCache.php
Civi/Api4/Service/Spec/Provider/ContactGetSpecProvider.php
tests/phpunit/CRM/Contact/Form/Search/Custom/datasets/group-dataset.xml

index f9121049df774f0b40bac3395c91d03cb3d2efdb..6b44f38f5e45657c845a75ea2730a612263267f6 100644 (file)
@@ -835,7 +835,7 @@ ORDER BY   gc.contact_id, g.children
       if ($savedSearch['api_entity']) {
         $sql = self::getApiSQL($savedSearch, $groupID);
       }
-      elseif (!empty($savedSearch['form_values']['customSearchID'])) {
+      elseif (!empty($savedSearch['search_custom_id'])) {
         $sql = self::getCustomSearchSQL($savedSearch, $groupID);
       }
       else {
index 1e41abccba094b3626482b8381390c3c97e9d571..e6ff17de2700fd16e6230915f49944a781028e70 100644 (file)
@@ -58,7 +58,7 @@ class ContactGetSpecProvider implements Generic\SpecProviderInterface {
     $tempTable = \CRM_Utils_SQL_TempTable::build();
     $tempTable->createWithColumns('contact_id INT');
     $tableName = $tempTable->getName();
-    \CRM_Contact_BAO_GroupContactCache::populateTemporaryTableWithContactsInGroups($value, $tableName);
+    \CRM_Contact_BAO_GroupContactCache::populateTemporaryTableWithContactsInGroups((array) $value, $tableName);
     // SQL optimization - use INNER JOIN if the base table is Contact & this clause is not nested
     if ($fieldAlias === '`a`.`id`' && $operator === "IN" && !$depth) {
       $query->getQuery()->join($tableName, "INNER JOIN `$tableName` ON $fieldAlias = `$tableName`.contact_id");
index 2bffd53021f52c96397407d2a4f2e07aecbe9dae..2b177c4d14f54f0c41efbf88ae0d6101210015f6 100644 (file)
     />
     <civicrm_saved_search
         id="1"
+        search_custom_id="4"
         form_values='a:9:{s:5:"qfKey";s:32:"0123456789abcdef0123456789abcdef";s:13:"includeGroups";a:1:{i:0;s:1:"3";}s:13:"excludeGroups";a:0:{}s:11:"includeTags";a:0:{}s:11:"excludeTags";a:0:{}s:4:"task";s:2:"14";s:8:"radio_ts";s:6:"ts_all";s:14:"customSearchID";s:1:"4";s:17:"customSearchClass";s:36:"CRM_Contact_Form_Search_Custom_Group";}'
     />
     <civicrm_saved_search
         id="2"
+        search_custom_id="4"
         form_values='a:9:{s:5:"qfKey";s:32:"0123456789abcdef0123456789abcdef";s:13:"includeGroups";a:0:{}s:13:"excludeGroups";a:1:{i:0;s:1:"3";}s:11:"includeTags";a:0:{}s:11:"excludeTags";a:0:{}s:4:"task";s:2:"14";s:8:"radio_ts";s:6:"ts_all";s:14:"customSearchID";s:1:"4";s:17:"customSearchClass";s:36:"CRM_Contact_Form_Search_Custom_Group";}'
     />
     <civicrm_group