CRM-14996 - Fix display bug in adv search
authorColeman Watts <coleman@civicrm.org>
Fri, 22 Aug 2014 08:45:15 +0000 (09:45 +0100)
committerColeman Watts <coleman@civicrm.org>
Fri, 22 Aug 2014 08:45:53 +0000 (09:45 +0100)
CRM/Contact/BAO/Query.php
CRM/Contact/Form/Search/Criteria.php
CRM/Core/BAO/Address.php

index a636a96041370d0de73340e3da0157679de15b44..0781e4d1e2eaf0bced01ed88eb9f3e9c78c5ee3e 100644 (file)
@@ -3797,9 +3797,8 @@ WHERE  id IN ( $groupIDs )
       }
       $stateClause = "civicrm_address.state_province_id $op (" . implode(',', $value) . ')';
 
-      $stateProvince = CRM_Core_PseudoConstant::stateProvince();
       foreach ($value as $id) {
-        $names[] = CRM_Utils_Array::value($id, $stateProvince);
+        $names[] = CRM_Core_PseudoConstant::stateProvince($id, FALSE);
       }
     }
     else {
index 598cd72b80a9fc9ce2390ca461e1194cdc4064b5..d550a53311d6a8c203083f39413a6f9d09700fe7 100644 (file)
@@ -305,6 +305,7 @@ class CRM_Contact_Form_Search_Criteria {
 
     $parseStreetAddress = CRM_Utils_Array::value('street_address_parsing', $addressOptions, 0);
     $form->assign('parseStreetAddress', $parseStreetAddress);
+    $stateCountryMap = NULL;
     foreach ($elements as $name => $v) {
       list($title, $attributes, $select, $multiSelect) = $v;
 
@@ -324,11 +325,11 @@ class CRM_Contact_Form_Search_Criteria {
       }
 
       if ($select) {
-        $stateCountryMap[] = array(
+        $stateCountryMap = array(array(
           'state_province' => 'state_province',
           'country' => 'country',
           'county' => 'county',
-        );
+        ));
         if ($select == 'stateProvince') {
           if (!empty($formValues['country'])) {
             $selectElements = array('' => ts('- select -')) + CRM_Core_PseudoConstant::stateProvinceForCountry($formValues['country']);
index a7e18e3ac02bf388c5c65c95d063197b1044211a..7d52be6219a4495b1c1c96803dd8184052655b9d 100644 (file)
@@ -659,7 +659,7 @@ ORDER BY civicrm_address.is_primary DESC, civicrm_address.location_type_id DESC,
    * @param $stateCountryMap
    * @param null $defaults
    */
-  static function addStateCountryMap(&$stateCountryMap, $defaults = NULL) {
+  static function addStateCountryMap($stateCountryMap, $defaults = NULL) {
     // first fix the statecountry map if needed
     if (empty($stateCountryMap)) {
       return;