Details
-
Type: Bug
-
Status: To Backport
-
Priority: Minor
-
Resolution: Fixed/Completed
-
Affects Version/s: 4.2.0, 4.3.0, 4.4.0, 4.5
-
Fix Version/s: 4.5
-
Component/s: CiviCRM Search
-
Labels:
Description
relate to #CRM-11644, Have reproduced on drupal.demo.civicrm.org, see attachment below.
It's only affect when both location related field is primary. Such as phone, we have both mobile and house as primary field.
The query builder will generate sql for both these field as
```sql
AND `1-phone-1`.is_primary = 1
AND `1-phone-2`.is_primary = 1
```
Maybe because the condition will always get from this line at Contact/BAO/Query.php
```php
foreach ($this->_returnProperties['location'] as $name => $elements) {
$cond = self::getPrimaryCondition($elementType);
```
github line: http://goo.gl/Eu6P7N