diff --git a/CRM/Activity/BAO/Activity.php b/CRM/Activity/BAO/Activity.php index 69442988d896..13d59afe0022 100644 --- a/CRM/Activity/BAO/Activity.php +++ b/CRM/Activity/BAO/Activity.php @@ -255,11 +255,10 @@ public static function deleteActivityContact($activityId, $recordTypeID = NULL) * @param array $params * Associated array of the submitted values. * + * @return CRM_Activity_DAO_Activity * @throws CRM_Core_Exception - * - * @return CRM_Activity_BAO_Activity|null|object */ - public static function create(&$params) { + public static function create(array &$params) { // CRM-20958 - These fields are managed by MySQL triggers. Watch out for clients resaving stale timestamps. unset($params['created_date']); unset($params['modified_date']); @@ -317,14 +316,8 @@ public static function create(&$params) { // start transaction $transaction = new CRM_Core_Transaction(); - $result = $activity->save(); - if (is_a($result, 'CRM_Core_Error')) { - $transaction->rollback(); - return $result; - } - $activityId = $activity->id; $activityRecordTypes = [ 'source_contact_id' => CRM_Core_PseudoConstant::getKey('CRM_Activity_BAO_ActivityContact', 'record_type_id', 'Activity Source'),