From a81b736d2901bc8194f6064bc5bc2cf3a28603f0 Mon Sep 17 00:00:00 2001 From: Jamie McClelland Date: Wed, 13 Aug 2014 17:14:57 -0400 Subject: [PATCH] CRM-15112 - allow dev to not rebuild triggers when creating custom fields via api. ---------------------------------------- * CRM-15112: API create CustomField should expose ability to not rebuild triggers https://issues.civicrm.org/jira/browse/CRM-15112 --- CRM/Core/BAO/CustomField.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CRM/Core/BAO/CustomField.php b/CRM/Core/BAO/CustomField.php index 4a902f1054..4c90b62952 100644 --- a/CRM/Core/BAO/CustomField.php +++ b/CRM/Core/BAO/CustomField.php @@ -285,9 +285,10 @@ class CRM_Core_BAO_CustomField extends CRM_Core_DAO_CustomField { // make sure all values are present in the object for further processing $customField->find(TRUE); + $triggerRebuild = CRM_Utils_Array::value('triggerRebuild', $params, TRUE); //create/drop the index when we toggle the is_searchable flag if (!empty($params['id'])) { - self::createField($customField, 'modify', $indexExist); + self::createField($customField, 'modify', $indexExist, $triggerRebuild); } else { if (!isset($origParams['column_name'])) { @@ -299,7 +300,8 @@ class CRM_Core_BAO_CustomField extends CRM_Core_DAO_CustomField { // make sure all values are present in the object $customField->find(TRUE); - self::createField($customField, 'add'); + $indexExist = FALSE; + self::createField($customField, 'add', $indexExist, $triggerRebuild); } // complete transaction -- 2.25.1