From 6e7e6dc0f97ab9767eeecf146441cf49b95169de Mon Sep 17 00:00:00 2001 From: Pratik Joshi Date: Mon, 8 Jul 2013 20:31:22 +0530 Subject: [PATCH] CRM-13011 : applied the patch --- CRM/Contact/BAO/Query.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CRM/Contact/BAO/Query.php b/CRM/Contact/BAO/Query.php index b02f972a88..ea7e41a501 100644 --- a/CRM/Contact/BAO/Query.php +++ b/CRM/Contact/BAO/Query.php @@ -860,7 +860,10 @@ class CRM_Contact_BAO_Query { if (($elementName != 'phone') && ($elementName != 'im')) { $cond = self::getPrimaryCondition($elementType); } - if ((!$cond) && ($elementName == 'phone')) { + // CRM-13011 : If location type is primary, do not restrict search to the phone + // type id - we want the primary phone, regardless of what type it is. + // Otherwise, restrict to the specified phone type for the given field. + if ((!$cond) && ($elementName == 'phone') && $elements['location_type'] != 'Primary') { $cond = "phone_type_id = '$elementType'"; } elseif ((!$cond) && ($elementName == 'im')) { -- 2.25.1