From 2c9e83fafa1c322e60c39defd2662a99f839085c Mon Sep 17 00:00:00 2001 From: Matthew Wire Date: Mon, 25 May 2020 15:29:03 +0100 Subject: [PATCH] Set default using spec for activity_date_time --- api/v3/Activity.php | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/api/v3/Activity.php b/api/v3/Activity.php index d02aaa2d02..c7c1288a92 100644 --- a/api/v3/Activity.php +++ b/api/v3/Activity.php @@ -202,6 +202,8 @@ function _civicrm_api3_activity_create_spec(&$params) { 'FKApiName' => 'Case', ]; + $params['activity_date_time']['api.default'] = date('YmdHis'); + } /** @@ -739,13 +741,6 @@ function _civicrm_api3_activity_check_params(&$params) { throw new API_Exception('Invalid Activity Duration (in minutes)'); } - //if adding a new activity & date_time not set make it now - // this should be managed by the wrapper layer & setting ['api.default'] in speces - // needs testing - if (empty($params['id']) && empty($params['activity_date_time'])) { - $params['activity_date_time'] = CRM_Utils_Date::processDate(date('Y-m-d H:i:s')); - } - return NULL; } -- 2.25.1