CRM-15191 - Ensure the cache gets cleared after updating custom fields via api
authorColeman Watts <coleman@civicrm.org>
Wed, 27 Aug 2014 20:27:32 +0000 (21:27 +0100)
committerColeman Watts <coleman@civicrm.org>
Wed, 27 Aug 2014 20:27:32 +0000 (21:27 +0100)
api/v3/CustomField.php
api/v3/CustomGroup.php

index e14a9b0f97d4375552858ddedd9ebc95f984a161..adc3f3b4a5e80da1dfa0ab914bbc96392bdc5931 100644 (file)
@@ -279,3 +279,14 @@ SELECT count(*)
   return $errors;
 }
 
+/**
+ * CRM-15191 - Hack to ensure the cache gets cleared after updating a custom field
+ */
+function civicrm_api3_custom_field_setvalue($params) {
+  require_once 'api/v3/Generic/Setvalue.php';
+  $result = civicrm_api3_generic_setValue(array("entity" => 'custom_field', 'params' => $params));
+  if (empty($result['is_error'])) {
+    CRM_Utils_System::flushCache();
+  }
+  return $result;
+}
index c5cb7ca4a4910fa590ffbdf3353e88863eae9871..5f6de41f1ed0c756590d036d1cc0bc557b853f05 100644 (file)
@@ -129,3 +129,14 @@ function civicrm_api3_custom_group_get($params) {
   return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params);
 }
 
+/**
+ * CRM-15191 - Hack to ensure the cache gets cleared after updating a custom group
+ */
+function civicrm_api3_custom_group_setvalue($params) {
+  require_once 'api/v3/Generic/Setvalue.php';
+  $result = civicrm_api3_generic_setValue(array("entity" => 'custom_group', 'params' => $params));
+  if (empty($result['is_error'])) {
+    CRM_Utils_System::flushCache();
+  }
+  return $result;
+}