revert location_type changes
authormonishdeb <monish.deb@webaccessglobal.com>
Tue, 28 Jul 2015 04:41:31 +0000 (10:11 +0530)
committermonishdeb <monish.deb@webaccessglobal.com>
Sat, 22 Aug 2015 18:00:13 +0000 (23:30 +0530)
CRM/Contact/BAO/Query.php

index d9a3b2d1606d18de1c98ca95683225e2f63cdb24..b9ad94b685ebcae9a4849221de0dcd32cd643b27 100644 (file)
@@ -370,7 +370,6 @@ class CRM_Contact_BAO_Query {
     'email',
     'im',
     'address_name',
-    'location_type',
   );
 
   /**
@@ -2598,20 +2597,12 @@ class CRM_Contact_BAO_Query {
           elseif (strpos($name, '-openid') != 0) {
             $locationTypeName = 'openid';
           }
-          elseif (strpos($name, '-location_type') != 0) {
-            $extraLocationType = "\n$side JOIN civicrm_location_type `{$name}` ON ( `{$name}`.id = `{$name}-address`.location_type_id )";
-            $locationTypeName = "address";
-            $name .= "-address";
-          }
 
           if ($locationTypeName) {
             //we have a join on an location table - possibly in conjunction with search builder - CRM-14263
             $parts = explode('-', $name);
             $locationID = array_search($parts[0], CRM_Core_BAO_Address::buildOptions('location_type_id', 'get', array('name' => $parts[0])));
             $from .= " $side JOIN civicrm_{$locationTypeName} `{$name}` ON ( contact_a.id = `{$name}`.contact_id ) and `{$name}`.location_type_id = $locationID ";
-            if (!empty($extraLocationType)) {
-              $from .= $extraLocationType;
-            }
           }
           else {
             $from .= CRM_Core_Component::from($name, $mode, $side);