Merge pull request #14485 from seamuslee001/domain_uniqueness_cache_key
authorEileen McNaughton <emcnaughton@wikimedia.org>
Wed, 12 Jun 2019 09:22:41 +0000 (05:22 -0400)
committerGitHub <noreply@github.com>
Wed, 12 Jun 2019 09:22:41 +0000 (05:22 -0400)
Add in uniqueness to cache keys to mitigate clashes on multisite inst…

CRM/Contact/BAO/Contact.php
CRM/Core/BAO/CustomField.php
CRM/Core/BAO/Navigation.php

index cf540790ed10087b353470fce00e9e8ed74fb8a8..7d14338e4c4e3c69b188fb64581414ca91b989b9 100644 (file)
@@ -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);
 
index 8d22e52f2198620bccf52113d58a0ea84ecdba80..32c1e58f7205bfc1cfd6fcf8fa4edc86733bb7ea 100644 (file)
@@ -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();
 
index 90cc56fb1cf30484917fbb2823b932ad61a419ec..bac09cd73cc19a0a3dc3f9cb2f91a692ae96f078 100644 (file)
@@ -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();