From 3ba820ea8bb8edcdfcd5b4e2d78674c9ef7cf0cc Mon Sep 17 00:00:00 2001 From: Chris Burgess Date: Tue, 26 Jul 2016 16:19:20 +1200 Subject: [PATCH] CRM-19131. Only set source contact ID if we got a value for it. --- CRM/Utils/DeprecatedUtils.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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) { -- 2.25.1