From 5322ae1213fe39af6459edd24acc9ca78a082d78 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Wed, 27 Aug 2014 21:27:32 +0100 Subject: [PATCH] CRM-15191 - Ensure the cache gets cleared after updating custom fields via api --- api/v3/CustomField.php | 11 +++++++++++ api/v3/CustomGroup.php | 11 +++++++++++ 2 files changed, 22 insertions(+) diff --git a/api/v3/CustomField.php b/api/v3/CustomField.php index e14a9b0f97..adc3f3b4a5 100644 --- a/api/v3/CustomField.php +++ b/api/v3/CustomField.php @@ -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; +} diff --git a/api/v3/CustomGroup.php b/api/v3/CustomGroup.php index c5cb7ca4a4..5f6de41f1e 100644 --- a/api/v3/CustomGroup.php +++ b/api/v3/CustomGroup.php @@ -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; +} -- 2.25.1