From 99c5b7519fa0c7ad5836f860e2092f8ca0e9b841 Mon Sep 17 00:00:00 2001 From: eileen Date: Sat, 2 May 2020 19:49:07 +1200 Subject: [PATCH] [REF] Minor code cleanup. Once we compress the 2 ifs we find the value in the 'else' is never used --- CRM/Contribute/BAO/ContributionPage.php | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/CRM/Contribute/BAO/ContributionPage.php b/CRM/Contribute/BAO/ContributionPage.php index d050ef3d7e..959b5923cd 100644 --- a/CRM/Contribute/BAO/ContributionPage.php +++ b/CRM/Contribute/BAO/ContributionPage.php @@ -280,19 +280,8 @@ class CRM_Contribute_BAO_ContributionPage extends CRM_Contribute_DAO_Contributio ) { $template = CRM_Core_Smarty::singleton(); - // get the billing location type if (!array_key_exists('related_contact', $values)) { - $billingLocationTypeId = CRM_Core_BAO_LocationType::getBilling(); - } - else { - // presence of related contact implies onbehalf of org case, - // where location type is set to default. - $locType = CRM_Core_BAO_LocationType::getDefault(); - $billingLocationTypeId = $locType->id; - } - - if (!array_key_exists('related_contact', $values)) { - list($displayName, $email) = CRM_Contact_BAO_Contact_Location::getEmailDetails($contactID, FALSE, $billingLocationTypeId); + list($displayName, $email) = CRM_Contact_BAO_Contact_Location::getEmailDetails($contactID, FALSE, CRM_Core_BAO_LocationType::getBilling()); } // get primary location email if no email exist( for billing location). if (!$email) { -- 2.25.1