From 001a663557d7457e0bc36589db081fd9a7230e33 Mon Sep 17 00:00:00 2001 From: Johan Vervloet Date: Tue, 13 Oct 2015 13:45:02 +0200 Subject: [PATCH] CRM-17125 - don't ignore 'is_billing'-parameter in Address BAO. If you want the billing address on a receipt, and if you use the getValues function of the Address BAO to retrieve it, the 'is_billing'-parameter should not be ignored by the BAO. ---------------------------------------- * CRM-17125: Add contact billing adress to contribution message when no contribution address https://issues.civicrm.org/jira/browse/CRM-17125 --- CRM/Core/BAO/Address.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/CRM/Core/BAO/Address.php b/CRM/Core/BAO/Address.php index 0cd1448e5a..dbc3d48938 100644 --- a/CRM/Core/BAO/Address.php +++ b/CRM/Core/BAO/Address.php @@ -483,8 +483,13 @@ class CRM_Core_BAO_Address extends CRM_Core_DAO_Address { return $addresses; } } - //get primary address as a first block. - $address->orderBy('is_primary desc, id'); + if (isset($entityBlock['is_billing']) && $entityBlock['is_billing'] == 1) { + $address->orderBy('is_billing desc, id'); + } + else { + //get primary address as a first block. + $address->orderBy('is_primary desc, id'); + } $address->find(); -- 2.25.1