From ca5c1e43cbb97262b55d12f522a3964cf293e59f Mon Sep 17 00:00:00 2001 From: eileen Date: Thu, 9 Jan 2020 18:33:16 +1300 Subject: [PATCH] [REF] Remove never-passed param from getLineItems Parameter was added to getLineItems in https://github.com/civicrm/civicrm-core/commit/25d0c6478ee236a4ac150e8d2b39614602ca4ae8 to support invoicing. However that function no longer calls getLineItems & has not for some time (at least a year). No other functions pass in this parameter so we can remove it --- CRM/Price/BAO/LineItem.php | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/CRM/Price/BAO/LineItem.php b/CRM/Price/BAO/LineItem.php index efa24b312bac..5e16642c5850 100644 --- a/CRM/Price/BAO/LineItem.php +++ b/CRM/Price/BAO/LineItem.php @@ -181,11 +181,10 @@ public static function getLineItemsByContributionID($contributionID) { * @param bool $isQtyZero * @param bool $relatedEntity * - * @param bool $invoice * @return array * Array of line items */ - public static function getLineItems($entityId, $entity = 'participant', $isQuick = FALSE, $isQtyZero = TRUE, $relatedEntity = FALSE, $invoice = FALSE) { + public static function getLineItems($entityId, $entity = 'participant', $isQuick = FALSE, $isQtyZero = TRUE, $relatedEntity = FALSE) { $whereClause = $fromClause = NULL; $selectClause = " SELECT li.id, @@ -218,17 +217,7 @@ public static function getLineItems($entityId, $entity = 'participant', $isQuick LEFT JOIN civicrm_line_item li ON ({$condition}) LEFT JOIN civicrm_price_field_value pfv ON ( pfv.id = li.price_field_value_id ) LEFT JOIN civicrm_price_field pf ON (pf.id = li.price_field_id )"; - $whereClause = " - WHERE %2.id = %1"; - - // CRM-16250 get additional participant's fee selection details only for invoice PDF (if any) - if ($entity == 'participant' && $invoice) { - $additionalParticipantIDs = CRM_Event_BAO_Participant::getAdditionalParticipantIds($entityId); - if (!empty($additionalParticipantIDs)) { - $whereClause = "WHERE %2.id IN (%1, " . implode(', ', $additionalParticipantIDs) . ")"; - } - } - + $whereClause = " WHERE %2.id = %1"; $orderByClause = " ORDER BY pf.weight, pfv.weight"; if ($isQuick) {