CRM-13617 - fix linking state province and country in multi-value custom fields
authoryashodha <yashodha.chaku@webaccess.co.in>
Wed, 13 Nov 2013 04:44:51 +0000 (10:14 +0530)
committeryashodha <yashodha.chaku@webaccess.co.in>
Wed, 13 Nov 2013 04:44:51 +0000 (10:14 +0530)
CRM/Core/BAO/CustomGroup.php

index d2bd512743bb7b09801efd0cf337dc8b748f62da..775e26039147f44e07f7c62fe8cb974192b27986 100644 (file)
@@ -1490,6 +1490,13 @@ ORDER BY civicrm_custom_group.weight,
         CRM_Core_BAO_CustomField::addQuickFormElement($form, $elementName, $fieldId, $inactiveNeeded, $required);
       }
     }
+    if (!empty($form->_stateCountryMap['state_province']) && !empty($form->_stateCountryMap['country'])) {
+      foreach ($form->_stateCountryMap['state_province'] as $key => $value) {
+        $stateCountryMap[$key]['state_province'] = $value;
+        $stateCountryMap[$key]['country'] = $form->_stateCountryMap['country'][$key];
+      }
+      CRM_Core_BAO_Address::addStateCountryMap($stateCountryMap);
+    }
   }
 
   /**