Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert Custom Data cache group to be using standard cache backend #14582

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion CRM/Core/BAO/Cache/Psr16.php
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,6 @@ public static function getLegacyGroups() {
$groups = [
// Core
'contact fields',
'custom data',

// Universe

Expand Down
4 changes: 2 additions & 2 deletions CRM/Core/BAO/CustomGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -1818,7 +1818,7 @@ public static function formatGroupTree(&$groupTree, $groupCount = 1, &$form = NU

// fetch submitted custom field values later use to set as a default values
if ($qfKey) {
$submittedValues = CRM_Core_BAO_Cache::getItem('custom data', $qfKey);
$submittedValues = Civi::cache('customData')->get($qfKey);
}

foreach ($groupTree as $key => $value) {
Expand Down Expand Up @@ -1877,7 +1877,7 @@ public static function formatGroupTree(&$groupTree, $groupCount = 1, &$form = NU
if (count($formValues)) {
$qf = $form->get('qfKey');
$form->assign('qfKey', $qf);
CRM_Core_BAO_Cache::setItem($formValues, 'custom data', $qf);
Civi::cache('customData')->set($qf, $formValues);
}

// hack for field type File
Expand Down
1 change: 1 addition & 0 deletions CRM/Utils/System.php
Original file line number Diff line number Diff line change
Expand Up @@ -1441,6 +1441,7 @@ public static function flushCache() {
Civi::cache('community_messages')->flush();
Civi::cache('groups')->flush();
Civi::cache('navigation')->flush();
Civi::cache('customData')->flush();
CRM_Extension_System::singleton()->getCache()->flush();
CRM_Cxn_CiviCxnHttp::singleton()->getCache()->flush();
}
Expand Down
3 changes: 2 additions & 1 deletion Civi/Core/Container.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ public function createContainer() {
'long' => 'long',
'groups' => 'contact groups',
'navigation' => 'navigation',
'customData' => 'custom data',
];
foreach ($basicCaches as $cacheSvc => $cacheGrp) {
$definitionParams = [
Expand All @@ -167,7 +168,7 @@ public function createContainer() {
// For Caches that we don't really care about the ttl for and/or maybe accessed
// fairly often we use the fastArrayDecorator which improves reads and writes, these
// caches should also not have concurrency risk.
$fastArrayCaches = ['groups', 'navigation'];
$fastArrayCaches = ['groups', 'navigation', 'customData'];
if (in_array($cacheSvc, $fastArrayCaches)) {
$definitionParams['withArray'] = 'fast';
}
Expand Down