CRM-16063 - MailingComponent.create API - is_active=1 by default
authorTim Otten <totten@civicrm.org>
Sat, 7 Mar 2015 04:29:01 +0000 (20:29 -0800)
committerTim Otten <totten@civicrm.org>
Sat, 7 Mar 2015 04:29:15 +0000 (20:29 -0800)
api/v3/MailingComponent.php

index 811fdefb85df4162105f3f294faf8b967db49a8f..6284cdbc0cb874a73c502e011299778bb76c3238 100644 (file)
@@ -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
  *