X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FUtils%2FCache%2FSqlGroup.php;h=3aa8bb17c0f2935f63fde2c79000ae5dda3b13b3;hb=554bfe5dfb6c7e64e7b8f4f122910fde8b8b95c4;hp=7b4df7dcc9a5b29a3312e5016963f88384f0426c;hpb=96a22bf0366560fca347a23ae91b6001d37d8846;p=civicrm-core.git diff --git a/CRM/Utils/Cache/SqlGroup.php b/CRM/Utils/Cache/SqlGroup.php index 7b4df7dcc9..3aa8bb17c0 100644 --- a/CRM/Utils/Cache/SqlGroup.php +++ b/CRM/Utils/Cache/SqlGroup.php @@ -1,34 +1,18 @@ group == CRM_Utils_Cache::cleanKey('CiviCRM Search PrevNextCache')) { + Civi::service('prevnext')->deleteItem(NULL, $key); + } CRM_Core_DAO::executeQuery("DELETE FROM {$this->table} WHERE {$this->where($key)}"); unset($this->valueCache[$key]); unset($this->expiresCache[$key]); @@ -220,7 +209,14 @@ class CRM_Utils_Cache_SqlGroup implements CRM_Utils_Cache_Interface { } public function flush() { - CRM_Core_DAO::executeQuery("DELETE FROM {$this->table} WHERE {$this->where()}"); + if ($this->group == CRM_Utils_Cache::cleanKey('CiviCRM Search PrevNextCache') && + Civi::service('prevnext') instanceof CRM_Core_PrevNextCache_Sql) { + // Use the standard PrevNextCache cleanup function here not just delete from civicrm_cache + CRM_Core_BAO_PrevNextCache::cleanupCache(); + } + else { + CRM_Core_DAO::executeQuery("DELETE FROM {$this->table} WHERE {$this->where()}"); + } $this->valueCache = []; $this->expiresCache = []; return TRUE;