From: Tim Otten Date: Fri, 4 Jan 2019 03:20:28 +0000 (-0800) Subject: (dev/core#635) CRM_Contact_Selector - Move count to 'long' cache X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=45b25a1bd527e5614ce1096b6dc5a090a95e30a9;p=civicrm-core.git (dev/core#635) CRM_Contact_Selector - Move count to 'long' cache The selector was set to specifically store the size of the result set in the SQL-based cache. For epic:ro-db, we should be able to store these in a non-SQL location. The `long` cache suffices. --- diff --git a/CRM/Contact/Selector.php b/CRM/Contact/Selector.php index 989716ddb4..9418ff2282 100644 --- a/CRM/Contact/Selector.php +++ b/CRM/Contact/Selector.php @@ -536,11 +536,11 @@ class CRM_Contact_Selector extends CRM_Core_Selector_Base implements CRM_Core_Se public function getTotalCount($action) { // Use count from cache during paging/sorting if (!empty($_GET['crmPID']) || !empty($_GET['crmSID'])) { - $count = CRM_Core_BAO_Cache::getItem('Search Results Count', $this->_key); + $count = Civi::cache('long')->get("Search Results Count $this->_key"); } if (empty($count)) { $count = $this->_query->searchQuery(0, 0, NULL, TRUE); - CRM_Core_BAO_Cache::setItem($count, 'Search Results Count', $this->_key); + Civi::cache('long')->set("Search Results Count $this->_key", $count); } return $count; }