Merge pull request #2124 from adamwight/cg
[civicrm-core.git] / api / v3 / ActionSchedule.php
index 1e32f917d1602ad4e7edbf492fdc13b7b544c55d..d910f68ae41c9872eaa3aab5b0c53a81bf2f4138 100644 (file)
@@ -60,6 +60,16 @@ function civicrm_api3_action_schedule_get($params) {
  * {@getfields action_schedule_create}
  */
 function civicrm_api3_action_schedule_create($params) {
+  if (!CRM_Utils_Array::value('id', $params)) {
+    // an update does not require any mandatory parameters
+    civicrm_api3_verify_one_mandatory($params,
+      NULL,
+      array(
+        'title','mapping_id', 'entity_status', 'entity_value',
+      )
+    );
+  }
+  
   $ids = array();
   if (isset($params['id']) && !CRM_Utils_Rule::integer($params['id'])) {
     return civicrm_api3_create_error('Invalid value for ID');
@@ -103,4 +113,6 @@ function _civicrm_api3_action_schedule_create_spec(&$params) {
  */
 function civicrm_api3_action_schedule_delete($params) {
   return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params);
-}
\ No newline at end of file
+}
+
+