Skip to content

Commit

Permalink
CRM-20687: Invert logic and rename variable to remove issue reference
Browse files Browse the repository at this point in the history
  • Loading branch information
mickadoo committed Jun 6, 2017
1 parent de4b583 commit 602e715
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Civi/API/Subscriber/ChainSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ protected function callNestedApi($apiKernel, &$params, &$result, $action, $entit
$subParams['entity_table'] = 'civicrm_' . $lowercase_entity;
}

$crm16084 = FALSE;
$addEntityId = TRUE;
if ($subEntity == 'relationship' && $lowercase_entity == 'contact') {
// if a relationship call is chained to a contact call, we need
// to check whether contact_id_a or contact_id_b for the
Expand All @@ -159,12 +159,12 @@ protected function callNestedApi($apiKernel, &$params, &$result, $action, $entit
// See CRM-16084.
foreach (array_keys($newparams) as $key) {
if (substr($key, 0, 11) == 'contact_id_') {
$crm16084 = TRUE;
$addEntityId = FALSE;
break;
}
}
}
if (!$crm16084) {
if ($addEntityId) {
$subParams[$lowercase_entity . "_id"] = $parentAPIValues['id'];
}
}
Expand Down

0 comments on commit 602e715

Please sign in to comment.