CRM-8963
authorDonald A. Lobo <lobo@civicrm.org>
Sat, 13 Apr 2013 15:11:01 +0000 (08:11 -0700)
committerDonald A. Lobo <lobo@civicrm.org>
Sat, 13 Apr 2013 15:11:01 +0000 (08:11 -0700)
----------------------------------------
* CRM-8963: Batch update profile: states do not change with country
  http://issues.civicrm.org/jira/browse/CRM-8963

CRM/Core/BAO/Address.php

index a3bf099b0d5dfcaf6750edd97ae6800e27054382..b12a481c65878ebef867dab7974aba1e56404a75 100644 (file)
@@ -665,8 +665,14 @@ ORDER BY civicrm_address.is_primary DESC, civicrm_address.location_type_id DESC,
 
   static function fixAllStateSelects(&$form, $defaults, $batchFieldNames = false) {
     $config = CRM_Core_Config::singleton();
-    
-    $map = is_array($batchFieldNames) ? $batchFieldNames : $config->stateCountryMap;
+
+    $map = null;
+    if (is_array($batchFieldNames)) {
+      $map = $batchFieldNames;
+    }
+    else if (!empty($config->stateCountryMap)) {
+      $map = $config->stateCountryMap;
+    }
 
     if (!empty($map)) {
       foreach ($map as $index => $match) {