From 0136044eac4342771aec9480e373da4167f2ae32 Mon Sep 17 00:00:00 2001 From: Seamus Lee Date: Wed, 19 Jun 2019 08:53:18 +1000 Subject: [PATCH] Convert Contact Groups cache group to standard cache defition --- CRM/Contact/BAO/GroupNestingCache.php | 10 +++++----- CRM/Core/BAO/Cache/Psr16.php | 1 - Civi/Core/Container.php | 1 + 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/CRM/Contact/BAO/GroupNestingCache.php b/CRM/Contact/BAO/GroupNestingCache.php index e48d988b90..49efecdcef 100644 --- a/CRM/Contact/BAO/GroupNestingCache.php +++ b/CRM/Contact/BAO/GroupNestingCache.php @@ -100,7 +100,7 @@ WHERE id = $id } // this tree stuff is quite useful, so lets store it in the cache - CRM_Core_BAO_Cache::setItem($tree, 'contact groups', 'nestable tree hierarchy'); + Civi::cache('groups')->set('nestable tree hierarchy', $tree); } /** @@ -153,11 +153,11 @@ WHERE id = $id * @return array */ public static function getPotentialCandidates($id, &$groups) { - $tree = CRM_Core_BAO_Cache::getItem('contact groups', 'nestable tree hierarchy'); + $tree = Civi::cache('groups')->get('nestable tree hierarchy'); if ($tree === NULL) { self::update(); - $tree = CRM_Core_BAO_Cache::getItem('contact groups', 'nestable tree hierarchy'); + $tree = Civi::cache('groups')->get('nestable tree hierarchy'); } $potential = $groups; @@ -219,11 +219,11 @@ WHERE id = $id * @return string */ public static function json() { - $tree = CRM_Core_BAO_Cache::getItem('contact groups', 'nestable tree hierarchy'); + $tree = Civi::cache('groups')->get('nestable tree hierarchy'); if ($tree === NULL) { self::update(); - $tree = CRM_Core_BAO_Cache::getItem('contact groups', 'nestable tree hierarchy'); + $tree = Civi::cache('groups')->get('nestable tree hierarchy'); } // get all the groups diff --git a/CRM/Core/BAO/Cache/Psr16.php b/CRM/Core/BAO/Cache/Psr16.php index 953d079618..45bfefeedd 100644 --- a/CRM/Core/BAO/Cache/Psr16.php +++ b/CRM/Core/BAO/Cache/Psr16.php @@ -185,7 +185,6 @@ class CRM_Core_BAO_Cache_Psr16 { 'CiviCRM Search PrevNextCache', 'contact fields', 'navigation', - 'contact groups', 'custom data', // Universe diff --git a/Civi/Core/Container.php b/Civi/Core/Container.php index e2d8411a4f..5a8ef7af03 100644 --- a/Civi/Core/Container.php +++ b/Civi/Core/Container.php @@ -156,6 +156,7 @@ class Container { 'checks' => 'checks', 'session' => 'CiviCRM Session', 'long' => 'long', + 'groups' => 'contact groups', ]; foreach ($basicCaches as $cacheSvc => $cacheGrp) { $container->setDefinition("cache.{$cacheSvc}", new Definition( -- 2.25.1