Remove duplicate layer of caching
authorEileen McNaughton <emcnaughton@wikimedia.org>
Sat, 18 Mar 2023 02:05:21 +0000 (15:05 +1300)
committerEileen McNaughton <emcnaughton@wikimedia.org>
Sat, 18 Mar 2023 22:15:48 +0000 (11:15 +1300)
This is cached within a cache - the load of calling it is not
especially high and it is somewhat unlikely the cache will be populated
anyway so let's simplfiy...

CRM/Dedupe/BAO/DedupeRuleGroup.php

index 59163f198670a0d238eb21e26fd0074ad0ac1100..a3ce6bbe64d3c7cee1f69d3518f9329ee49531fa 100644 (file)
@@ -143,12 +143,7 @@ class CRM_Dedupe_BAO_DedupeRuleGroup extends CRM_Dedupe_DAO_DedupeRuleGroup {
    */
   private static function importableFields($contactType): array {
 
-    $cacheKeyString = 'importableFields ' . $contactType . '_0_0_0_1';
-    $cacheKeyString .= '_' . CRM_Core_Config::domainID() . '_';
-
-    $fields = Civi::cache('fields')->get($cacheKeyString);
-
-    if (!$fields) {
+    if (TRUE) {
       $fields = CRM_Contact_DAO_Contact::import();
 
       // get the fields thar are meant for contact types
@@ -208,8 +203,6 @@ class CRM_Dedupe_BAO_DedupeRuleGroup extends CRM_Dedupe_DAO_DedupeRuleGroup {
 
       //Sorting fields in alphabetical order(CRM-1507)
       $fields = CRM_Utils_Array::crmArraySortByField($fields, 'title');
-
-      Civi::cache('fields')->set($cacheKeyString, $fields);
     }
     return $fields;
   }