From a3ceebba857d9c2afc1a32029be2ad4b8f6a241a Mon Sep 17 00:00:00 2001 From: vivekarora Date: Wed, 20 Nov 2013 13:24:04 +0530 Subject: [PATCH] Set name from title if that is not given in API --- api/v3/ActionSchedule.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/api/v3/ActionSchedule.php b/api/v3/ActionSchedule.php index ab92a06b2f..1e32f917d1 100644 --- a/api/v3/ActionSchedule.php +++ b/api/v3/ActionSchedule.php @@ -64,7 +64,11 @@ function civicrm_api3_action_schedule_create($params) { if (isset($params['id']) && !CRM_Utils_Rule::integer($params['id'])) { return civicrm_api3_create_error('Invalid value for ID'); } - + + if (!array_key_exists('name', $params) && !array_key_exists('id', $params)) { + $params['name'] = CRM_Utils_String::munge($params['title']); + } + $actionSchedule = new CRM_Core_BAO_ActionSchedule(); $actionSchedule = CRM_Core_BAO_ActionSchedule::add($params, $ids); -- 2.25.1