CRM-16284: Add missing phone location condition
authorJKingsnorth <john@johnkingsnorth.co.uk>
Wed, 15 Apr 2015 09:01:28 +0000 (10:01 +0100)
committerJohn <john@johnkingsnorth.co.uk>
Wed, 15 Apr 2015 21:47:27 +0000 (22:47 +0100)
CRM/Contact/BAO/Query.php

index 6c33c85af54b252151722a6e835b4b368894a7a9..8a96542ce69fce0bb45d274a7804fce64c3b3b93 100644 (file)
@@ -1165,6 +1165,9 @@ class CRM_Contact_BAO_Query {
                     //gross hack to pickup corrupted data also, CRM-7603
                     if (strpos($cond, 'phone_type_id') !== FALSE) {
                       $phoneTypeCondition = " AND ( `$tName`.$cond OR `$tName`.phone_type_id IS NULL ) ";
+                      if (!empty($lCond)) {
+                        $phoneTypeCondition .= " AND ( `$tName`.$lCond ) ";
+                      }
                     }
                     $this->_tables[$tName] .= $phoneTypeCondition;
                   }