Skip to content

Commit

Permalink
[REF] Remove always false if
Browse files Browse the repository at this point in the history
We recently added code to ensure line_item is always populated
before this function is called. So line items is never empty at this point
  • Loading branch information
eileenmcnaughton committed Jun 18, 2021
1 parent ad9ae5a commit efac3dc
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions CRM/Contribute/BAO/Contribution.php
Original file line number Diff line number Diff line change
Expand Up @@ -3407,6 +3407,10 @@ public static function recordFinancialAccounts(&$params, $financialTrxnValues =
$entityID[] = $entityId;
if (!empty($additionalParticipantId)) {
$entityID += $additionalParticipantId;
// build line item array if necessary
if ($additionalParticipantId) {
CRM_Price_BAO_LineItem::getLineItemArray($params, $entityID, str_replace('civicrm_', '', $entityTable));
}
}
// prevContribution appears to mean - original contribution object- ie copy of contribution from before the update started that is being updated
if (empty($params['prevContribution'])) {
Expand All @@ -3415,11 +3419,6 @@ public static function recordFinancialAccounts(&$params, $financialTrxnValues =

$statusId = $params['contribution']->contribution_status_id;

// build line item array if its not set in $params
if (empty($params['line_item']) || $additionalParticipantId) {
CRM_Price_BAO_LineItem::getLineItemArray($params, $entityID, str_replace('civicrm_', '', $entityTable), $isRelatedId);
}

if ($contributionStatus != 'Failed' &&
!($contributionStatus == 'Pending' && !$params['contribution']->is_pay_later)
) {
Expand Down

0 comments on commit efac3dc

Please sign in to comment.