From: Seamus Lee Date: Thu, 13 Jun 2019 06:07:25 +0000 (+1000) Subject: Update PSR16 handling for multisite extension legacy caching group X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=4e412e9c05a2eec569b96191e01ea235de9559f4;p=civicrm-core.git Update PSR16 handling for multisite extension legacy caching group Fix version to compare against --- diff --git a/CRM/Core/BAO/Cache/Psr16.php b/CRM/Core/BAO/Cache/Psr16.php index 03463d473e..1c353f7462 100644 --- a/CRM/Core/BAO/Cache/Psr16.php +++ b/CRM/Core/BAO/Cache/Psr16.php @@ -180,7 +180,7 @@ class CRM_Core_BAO_Cache_Psr16 { * @return array */ public static function getLegacyGroups() { - return [ + $groups = [ // Core 'CiviCRM Search PrevNextCache', 'contact fields', @@ -202,9 +202,17 @@ class CRM_Core_BAO_Cache_Psr16 { // nz.co.fuzion.entitysetting 'CiviCRM setting Spec', - // org.civicrm.multisite - 'descendant groups for an org', ]; + // Handle Legacy Multisite caching group. + $extensions = CRM_Extension_System::singleton()->getManager(); + $multisiteExtensionStatus = $extensions->getStatus('org.civicrm.multisite'); + if ($multisiteExtensionStatus == $extensions::STATUS_INSTALLED) { + $extension_version = civicrm_api3('Extension', 'get', ['key' => 'org.civicrm.multisite'])['values'][0]['version']; + if (version_compare($extension_version, '2.7', '<')) { + $groups[] = 'descendant groups for an org'; + } + } + return $groups; } }