From 6e36c320642b687204bb72bc1b95a067df785859 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Sat, 11 Nov 2017 11:32:04 -0500 Subject: [PATCH] CRM-21421 - Api case update should not re-save case contacts --- api/v3/Case.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/api/v3/Case.php b/api/v3/Case.php index bc263b0944..1cac5fd009 100644 --- a/api/v3/Case.php +++ b/api/v3/Case.php @@ -123,7 +123,7 @@ function civicrm_api3_case_create($params) { throw new API_Exception('Case not created. Please check input params.'); } - if (isset($params['contact_id'])) { + if (isset($params['contact_id']) && !isset($params['id'])) { foreach ((array) $params['contact_id'] as $cid) { $contactParams = array('case_id' => $caseBAO->id, 'contact_id' => $cid); CRM_Case_BAO_CaseContact::create($contactParams); @@ -217,6 +217,7 @@ function _civicrm_api3_case_create_spec(&$params) { 'description' => 'Contact id of case client(s)', 'api.required' => 1, 'type' => CRM_Utils_Type::T_INT, + 'FKApiName' => 'Contact', ); $params['status_id']['api.default'] = 1; $params['status_id']['api.aliases'] = array('case_status'); -- 2.25.1