Skip to content

Commit

Permalink
CRM-21421 - Api case update should not re-save case contacts
Browse files Browse the repository at this point in the history
  • Loading branch information
colemanw authored and sluc23 committed Jan 10, 2018
1 parent 1e3ee4b commit d611a27
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion api/v3/Case.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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');
Expand Down

0 comments on commit d611a27

Please sign in to comment.