From f4de748f8fe8cb730a5b84a39aae6acdf00a80b6 Mon Sep 17 00:00:00 2001 From: Seamus Lee Date: Sun, 9 Jun 2019 10:45:12 +1000 Subject: [PATCH] Add in uniqueness to cache keys to mitigate clashes on multisite installs --- CRM/Contact/BAO/Contact.php | 1 + CRM/Core/BAO/CustomField.php | 1 + CRM/Core/BAO/Navigation.php | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CRM/Contact/BAO/Contact.php b/CRM/Contact/BAO/Contact.php index cf540790ed..7d14338e4c 100644 --- a/CRM/Contact/BAO/Contact.php +++ b/CRM/Contact/BAO/Contact.php @@ -1318,6 +1318,7 @@ WHERE civicrm_contact.id = " . CRM_Utils_Type::escape($id, 'Integer'); $cacheKeyString .= $showAll ? '_1' : '_0'; $cacheKeyString .= $isProfile ? '_1' : '_0'; $cacheKeyString .= $checkPermission ? '_1' : '_0'; + $cacheKeyString .= '_' . CRM_Core_Config::domainID() . '_'; $fields = CRM_Utils_Array::value($cacheKeyString, self::$_importableFields); diff --git a/CRM/Core/BAO/CustomField.php b/CRM/Core/BAO/CustomField.php index 8d22e52f21..32c1e58f72 100644 --- a/CRM/Core/BAO/CustomField.php +++ b/CRM/Core/BAO/CustomField.php @@ -503,6 +503,7 @@ class CRM_Core_BAO_CustomField extends CRM_Core_DAO_CustomField { $cacheKey .= $onlyParent ? '_1_' : '_0_'; $cacheKey .= $onlySubType ? '_1_' : '_0_'; $cacheKey .= $checkPermission ? '_1_' : '_0_'; + $cacheKey .= '_' . CRM_Core_Config::domainID() . '_'; $cgTable = CRM_Core_DAO_CustomGroup::getTableName(); diff --git a/CRM/Core/BAO/Navigation.php b/CRM/Core/BAO/Navigation.php index 90cc56fb1c..bac09cd73c 100644 --- a/CRM/Core/BAO/Navigation.php +++ b/CRM/Core/BAO/Navigation.php @@ -159,7 +159,7 @@ class CRM_Core_BAO_Navigation extends CRM_Core_DAO_Navigation { * returns associated array */ public static function getNavigationList() { - $cacheKeyString = "navigationList"; + $cacheKeyString = "navigationList_" . CRM_Core_Config::domainID(); $whereClause = ''; $config = CRM_Core_Config::singleton(); -- 2.25.1