Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Development
Core
Commits
aed025fb
Commit
aed025fb
authored
Aug 25, 2020
by
JKingsnorth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#1971
Domain-specific option value caching
parent
d07e605a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
CRM/Core/OptionGroup.php
CRM/Core/OptionGroup.php
+7
-3
No files found.
CRM/Core/OptionGroup.php
View file @
aed025fb
...
...
@@ -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
()));
}
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment