Skip to content
Snippets Groups Projects
Commit 1aa104c5 authored by eileen's avatar eileen
Browse files

Fix deprecation warning on Price Set report

In 5.20 we added a deprecation warning on searches that are borked WRT filling the prev_next
cache & hence doing searches. The price set search falls into this camp & while it has
been broken forever the deprecation notice is new (& the fix is safe) so targettin 5.20
parent aa1396ec
Branches
Tags
No related merge requests found
......@@ -1016,6 +1016,8 @@ class CRM_Contact_Selector extends CRM_Core_Selector_Base implements CRM_Core_Se
* @param string $cacheKey
* @param int $start
* @param int $end
*
* @throws \CRM_Core_Exception
*/
public function fillupPrevNextCache($sort, $cacheKey, $start = 0, $end = self::CACHE_SIZE) {
$coreSearch = TRUE;
......@@ -1041,7 +1043,9 @@ class CRM_Contact_Selector extends CRM_Core_Selector_Base implements CRM_Core_Se
$selectSQL = CRM_Core_DAO::composeQuery("SELECT DISTINCT %1, contact_a.id, contact_a.sort_name", [1 => [$cacheKey, 'String']]);
$sql = str_ireplace(["SELECT contact_a.id as contact_id", "SELECT contact_a.id as id"], $selectSQL, $sql);
$sql = str_ireplace(['SELECT contact_a.id as contact_id', 'SELECT contact_a.id as id'], $selectSQL, $sql);
$sql = str_ireplace('ORDER BY `contact_id`', 'ORDER BY `id`', $sql, $sql);
try {
Civi::service('prevnext')->fillWithSql($cacheKey, $sql);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment