+/**
+ * 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;
+}