From 8a60e058dbac26e5a682051edbaa9a4b47f2ae3f Mon Sep 17 00:00:00 2001 From: Monish Deb Date: Tue, 9 Mar 2021 20:20:46 +0530 Subject: [PATCH] core#59: Address location type search errors when using a search profile --- CRM/Contact/BAO/Query.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CRM/Contact/BAO/Query.php b/CRM/Contact/BAO/Query.php index baa41722cd..b53ebface1 100644 --- a/CRM/Contact/BAO/Query.php +++ b/CRM/Contact/BAO/Query.php @@ -396,6 +396,7 @@ class CRM_Contact_BAO_Query { 'im', 'address_name', 'master_id', + 'location_type', ]; /** @@ -1281,6 +1282,14 @@ class CRM_Contact_BAO_Query { } break; + case 'civicrm_location_type': + $this->_tables[$tName] = "\nLEFT JOIN $tableName `$tName` ON `$tName`.id = $aName.location_type_id"; + + if ($addWhere) { + $this->_whereTables["{$name}-address"] = $addressJoin; + } + break; + case 'civicrm_country': $this->_pseudoConstantsSelect["{$name}-{$elementFullName}"]['table'] = $newName; $this->_pseudoConstantsSelect["{$name}-{$elementFullName}"]['join'] -- 2.25.1