From: Eileen McNaughton Date: Fri, 18 Jun 2021 05:09:39 +0000 (+1200) Subject: [REF] Remove always false if X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=efac3dcfd15c0d73422421bfd984710df368e755;p=civicrm-core.git [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 --- diff --git a/CRM/Contribute/BAO/Contribution.php b/CRM/Contribute/BAO/Contribution.php index 74a7a75a1a..8ede963283 100644 --- a/CRM/Contribute/BAO/Contribution.php +++ b/CRM/Contribute/BAO/Contribution.php @@ -3407,6 +3407,10 @@ INNER JOIN civicrm_activity ON civicrm_activity_contact.activity_id = civicrm_ac $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 @@ INNER JOIN civicrm_activity ON civicrm_activity_contact.activity_id = civicrm_ac $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) ) {