From efac3dcfd15c0d73422421bfd984710df368e755 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Fri, 18 Jun 2021 17:09:39 +1200 Subject: [PATCH] [REF] Remove always false if 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 --- CRM/Contribute/BAO/Contribution.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/CRM/Contribute/BAO/Contribution.php b/CRM/Contribute/BAO/Contribution.php index 74a7a75a1ab0..8ede9632837c 100644 --- a/CRM/Contribute/BAO/Contribution.php +++ b/CRM/Contribute/BAO/Contribution.php @@ -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'])) { @@ -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) ) {