worked on CRM-12916, setting state defaults
authorKurund Jalmi <kurund@civicrm.org>
Sat, 29 Jun 2013 16:48:58 +0000 (22:18 +0530)
committerKurund Jalmi <kurund@civicrm.org>
Sat, 29 Jun 2013 16:48:58 +0000 (22:18 +0530)
CRM/Event/Form/Registration/Register.php

index 1d46ace555aec802ffccaa2cb88a37408f301712..cfc43be1fe2ad0b626854b2b0fcbb93d44b60fef 100644 (file)
@@ -179,10 +179,9 @@ class CRM_Event_Form_Registration_Register extends CRM_Event_Form_Registration {
       $this->_defaults["billing_country_id-{$this->_bltID}"] = $config->defaultContactCountry;
     }
 
-    // now fix all state country selectors
-    CRM_Core_BAO_Address::fixAllStateSelects($this, $this->_defaults);
-
     if ($this->_snippet) {
+      // now fix all state country selectors
+      CRM_Core_BAO_Address::fixAllStateSelects($this, $this->_defaults);
       return $this->_defaults;
     }
 
@@ -214,6 +213,9 @@ class CRM_Event_Form_Registration_Register extends CRM_Event_Form_Registration {
       CRM_Core_BAO_UFGroup::setProfileDefaults($contactID, $fields, $this->_defaults);
     }
 
+    // now fix all state country selectors
+    CRM_Core_BAO_Address::fixAllStateSelects($this, $this->_defaults);
+
     // Set default payment processor as default payment_processor radio button value
     if (!empty($this->_paymentProcessors)) {
       foreach ($this->_paymentProcessors as $pid => $value) {