Commit aed025fb authored by JKingsnorth's avatar JKingsnorth

#1971 Domain-specific option value caching

parent d07e605a
......@@ -106,7 +106,12 @@ class CRM_Core_OptionGroup {
$orderBy = 'weight'
) {
$cache = CRM_Utils_Cache::singleton();
$cacheKey = self::createCacheKey($name, $flip, $grouping, $localize, $condition, $labelColumnName, $onlyActive, $keyColumnName, $orderBy);
if (in_array($name, self::$_domainIDGroups)) {
$cacheKey = self::createCacheKey($name, $flip, $grouping, $localize, $condition, $labelColumnName, $onlyActive, $keyColumnName, $orderBy, CRM_Core_Config::domainID());
}
else {
$cacheKey = self::createCacheKey($name, $flip, $grouping, $localize, $condition, $labelColumnName, $onlyActive, $keyColumnName, $orderBy);
}
if (!$fresh) {
// Fetch from static var
......@@ -186,8 +191,7 @@ WHERE v.option_group_id = g.id
* @return string
*/
protected static function createCacheKey($id) {
$cacheKey = "CRM_OG_" . preg_replace('/[^a-zA-Z0-9]/', '', $id) . '_' . md5(serialize(func_get_args()));
return $cacheKey;
return "CRM_OG_" . preg_replace('/[^a-zA-Z0-9]/', '', $id) . '_' . md5(serialize(func_get_args()));
}
/**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment