From: Chris Burgess Date: Tue, 26 Jul 2016 04:19:20 +0000 (+1200) Subject: CRM-19131. Only set source contact ID if we got a value for it. X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=3ba820ea8bb8edcdfcd5b4e2d78674c9ef7cf0cc;p=civicrm-core.git CRM-19131. Only set source contact ID if we got a value for it. --- diff --git a/CRM/Utils/DeprecatedUtils.php b/CRM/Utils/DeprecatedUtils.php index 93f9b37829..39c04d0f7b 100644 --- a/CRM/Utils/DeprecatedUtils.php +++ b/CRM/Utils/DeprecatedUtils.php @@ -1527,7 +1527,9 @@ function _civicrm_api3_deprecated_activity_buildmailparams($result, $activityTyp $params['activity_type_id'] = $activityTypeID; $params['status_id'] = 2; - $params['source_contact_id'] = $params['assignee_contact_id'] = $result['from']['id']; + if (!empty($result['from']['id'])) { + $params['source_contact_id'] = $params['assignee_contact_id'] = $result['from']['id']; + } $params['target_contact_id'] = array(); $keys = array('to', 'cc', 'bcc'); foreach ($keys as $key) {