From a00bd784aa9f7a696457236154b1a840f32fabd7 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Fri, 6 Oct 2023 15:43:50 +1300 Subject: [PATCH] Stop receiving billingID in createAddress BillingID is determined in the form in one of 2 ways - calling the function CRM_Core_BAO_LocationType::getBilling(); - hard-coding the number 5 There is no magic whereby it varies depending on the form & it is a source of many undefined property errors. I did a broader PR removing it, which stalled, so making this change makes it easier to remove piecemeal --- CRM/Contribute/BAO/Contribution.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CRM/Contribute/BAO/Contribution.php b/CRM/Contribute/BAO/Contribution.php index cc88625bb2..d293c6bd0f 100644 --- a/CRM/Contribute/BAO/Contribution.php +++ b/CRM/Contribute/BAO/Contribution.php @@ -1656,12 +1656,12 @@ LEFT JOIN civicrm_option_value contribution_status ON (civicrm_contribution.cont * thought). * * @param array $params - * @param int $billingLocationTypeID * * @return int * address id */ - public static function createAddress($params, $billingLocationTypeID) { + public static function createAddress($params) { + $billingLocationTypeID = CRM_Core_BAO_LocationType::getBilling(); [$hasBillingField, $addressParams] = self::getBillingAddressParams($params, $billingLocationTypeID); if ($hasBillingField) { $address = CRM_Core_BAO_Address::writeRecord($addressParams); -- 2.25.1