From 143fcffa5d0b50f6927d59dc693aa518f7c57dc0 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Fri, 6 Mar 2015 20:29:01 -0800 Subject: [PATCH] CRM-16063 - MailingComponent.create API - is_active=1 by default --- api/v3/MailingComponent.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/api/v3/MailingComponent.php b/api/v3/MailingComponent.php index 811fdefb85..6284cdbc0c 100644 --- a/api/v3/MailingComponent.php +++ b/api/v3/MailingComponent.php @@ -51,6 +51,19 @@ function civicrm_api3_mailing_component_create($params) { return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params); } + +/** + * Adjust Metadata for Create action. + * + * The metadata is used for setting defaults, documentation & validation. + * + * @param array $spec + * Array of parameters determined by getfields. + */ +function _civicrm_api3_mailing_component_create_spec(&$spec) { + $spec['is_active']['api.default'] = 1; +} + /** * Get a mailing_component * -- 2.25.1