From 728eefa0e803a782ab9fe9f2b852e94fc1111fa5 Mon Sep 17 00:00:00 2001 From: monishdeb Date: Mon, 27 Jul 2015 19:56:06 +0530 Subject: [PATCH] worldRegion fix --- CRM/Contact/BAO/Query.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/CRM/Contact/BAO/Query.php b/CRM/Contact/BAO/Query.php index 6e2150bcd1..a04f5341ee 100644 --- a/CRM/Contact/BAO/Query.php +++ b/CRM/Contact/BAO/Query.php @@ -2001,10 +2001,9 @@ class CRM_Contact_BAO_Query { $this->_qill[$grouping][] = ts("%1 %2 %3", array(1 => $field['title'], 2 => $qillop, 3 => $qillVal)); } elseif ($name === 'world_region') { - $field['where'] = 'civicrm_worldregion.id'; $this->optionValueQuery( $name, $op, $value, $grouping, - CRM_Core_PseudoConstant::worldRegion(), + NULL, $field, ts('World Region'), 'Positive', @@ -5492,7 +5491,6 @@ AND displayRelType.is_active = 1 else { $wc = self::caseImportant($op) ? "LOWER({$field['where']})" : "{$field['where']}"; } - if (in_array($name, $pseudoFields)) { if (!in_array($name, array('gender_id', 'prefix_id', 'suffix_id', 'communication_style_id'))) { $wc = "contact_a.{$name}_id"; @@ -5500,6 +5498,9 @@ AND displayRelType.is_active = 1 $dataType = 'Positive'; $value = (!$value) ? 0 : $value; } + if ($name == "world_region") { + $field['name'] = $name; + } list($qillop, $qillVal) = CRM_Contact_BAO_Query::buildQillForFieldValue($daoName, $field['name'], $value, $op); $this->_qill[$grouping][] = ts("%1 %2 %3", array(1 => $label, 2 => $qillop, 3 => $qillVal)); @@ -5707,6 +5708,9 @@ AND displayRelType.is_active = 1 elseif ($fieldName == 'county_id') { $pseduoOptions = CRM_Core_PseudoConstant::county(); } + elseif ($fieldName == 'world_region') { + $pseduoOptions = CRM_Core_PseudoConstant::worldRegion(); + } elseif ($daoName == 'CRM_Event_DAO_Event' && $fieldName == 'id') { $pseduoOptions = CRM_Event_BAO_Event::getEvents(0, $fieldValue, TRUE, TRUE, TRUE); } -- 2.25.1