Fix Redis deprecated warning
authoreileen <emcnaughton@wikimedia.org>
Fri, 12 Feb 2021 22:05:44 +0000 (11:05 +1300)
committereileen <emcnaughton@wikimedia.org>
Sun, 14 Feb 2021 23:11:02 +0000 (12:11 +1300)
It's not obvious why we would pass trapException here. I believe the issue is that
some custom searches result in 'acceptable' bad sql here but
https://github.com/civicrm/civicrm-core/commit/6dc40f3250ede0f38ce2aed7c3fabd3f1f667c1b
already fixed to catch any exception so we don't
need to convert. There is one other place that calls fillWithSql but there
is no evidence it is subject to the random issue on custom searches / needs
any attention at the moment

CRM/Core/PrevNextCache/Redis.php

index 5811de058183e9dbc68f80d0ce521b9264846886..8c574ae51c7a62424e7a769b7994bc306e5a747b 100644 (file)
@@ -46,10 +46,7 @@ class CRM_Core_PrevNextCache_Redis implements CRM_Core_PrevNextCache_Interface {
   }
 
   public function fillWithSql($cacheKey, $sql, $sqlParams = []) {
-    $dao = CRM_Core_DAO::executeQuery($sql, $sqlParams, FALSE, NULL, FALSE, TRUE, TRUE);
-    if (is_a($dao, 'DB_Error')) {
-      throw new CRM_Core_Exception($dao->message);
-    }
+    $dao = CRM_Core_DAO::executeQuery($sql, $sqlParams, FALSE);
 
     list($allKey, $dataKey, , $maxScore) = $this->initCacheKey($cacheKey);