Replicate current practice of resetting of ACL and System caches sensibly
authorSeamus Lee <seamuslee001@gmail.com>
Sat, 22 Jun 2019 03:41:17 +0000 (13:41 +1000)
committerSeamus Lee <seamuslee001@gmail.com>
Sun, 14 Jul 2019 12:20:33 +0000 (22:20 +1000)
CRM/ACL/BAO/ACL.php
CRM/ACL/Form/ACL.php
CRM/Core/BAO/CustomGroup.php
CRM/Custom/Form/ChangeFieldType.php
CRM/Custom/Form/Group.php

index aafc2cf2a19da878c592cf3592df61f8bc8faac9..71050fffbcf4b039c0978f1e751c85984f66d746 100644 (file)
@@ -688,10 +688,8 @@ SELECT $acl.*
    */
   public static function setIsActive($id, $is_active) {
     Civi::cache('fields')->flush();
-    // also reset ACL Cache
-    CRM_ACL_BAO_Cache::resetCache();
-    // also reset memory cache if any
-    CRM_Utils_System::flushCache();
+    // reset ACL and system caches.
+    CRM_Core_BAO_Cache::resetCaches();
 
     return CRM_Core_DAO::setFieldValue('CRM_ACL_DAO_ACL', $id, 'is_active', $is_active);
   }
index b0824e56b2a5a2b73ae4fce008eb092986594660..7f9419721437886a8499cb6b5bac45598e488b0d 100644 (file)
@@ -255,6 +255,8 @@ class CRM_ACL_Form_ACL extends CRM_Admin_Form {
   public function postProcess() {
     // note this also resets any ACL cache
     Civi::cache('fields')->flush();
+    // reset ACL and system caches.
+    CRM_Core_BAO_Cache::resetCaches();
 
     if ($this->_action & CRM_Core_Action::DELETE) {
       CRM_ACL_BAO_ACL::del($this->_id);
index b4da3671a14c1c472eef08f335d530c308150b65..3f92e2696b4d098919a3a59110051a468e2f4e39 100644 (file)
@@ -260,6 +260,8 @@ class CRM_Core_BAO_CustomGroup extends CRM_Core_DAO_CustomGroup {
   public static function setIsActive($id, $is_active) {
     // reset the cache
     Civi::cache('fields')->flush();
+    // reset ACL and system caches.
+    CRM_Core_BAO_Cache::resetCaches();
 
     if (!$is_active) {
       CRM_Core_BAO_UFField::setUFFieldStatus($id, $is_active);
index eb079dff197a959e11abe6b5153a74ff1f7b2ec7..06ff652e35b6e1c3d28261a566b04d78295af754 100644 (file)
@@ -188,6 +188,8 @@ class CRM_Custom_Form_ChangeFieldType extends CRM_Core_Form {
 
     // Reset cache for custom fields
     Civi::cache('fields')->flush();
+    // reset ACL and system caches.
+    CRM_Core_BAO_Cache::resetCaches();
 
     CRM_Core_Session::setStatus(ts('Input type of custom field \'%1\' has been successfully changed to \'%2\'.',
       [1 => $this->_values['label'], 2 => $dstHtmlType]
index bdc29294023f8268e5c31a23b39e50c33e3cb68a..5da4dd727f00c7cc2f011913611523843cdd98c4 100644 (file)
@@ -458,6 +458,8 @@ class CRM_Custom_Form_Group extends CRM_Core_Form {
 
     // reset the cache
     Civi::cache('fields')->flush();
+    // reset ACL and system caches.
+    CRM_Core_BAO_Cache::resetCaches();
 
     if ($this->_action & CRM_Core_Action::UPDATE) {
       CRM_Core_Session::setStatus(ts('Your custom field set \'%1 \' has been saved.', [1 => $group->title]), ts('Saved'), 'success');