-- CRM-11737 fix for anonymous user
authorRavish Nair <ravish.nair@webaccess.co.in>
Thu, 27 Jun 2013 10:02:40 +0000 (15:32 +0530)
committerRavish Nair <ravish.nair@webaccess.co.in>
Thu, 27 Jun 2013 10:02:40 +0000 (15:32 +0530)
----------------------------------------
* CRM-11737: PCP Account profile: state/country ajax not enabled
  http://issues.civicrm.org/jira/browse/CRM-11737

CRM/PCP/Form/PCPAccount.php

index 95e1ff2b58a960bdc763482692e4a1f81991d73e..81acc9083c155dd65a166ca0d972ae644b6763de 100644 (file)
@@ -108,16 +108,14 @@ class CRM_PCP_Form_PCPAccount extends CRM_Core_Form {
   }
 
   function setDefaultValues() {
-    if (!$this->_contactID) {
-      return;
+    if ($this->_contactID) {
+      foreach ($this->_fields as $name => $dontcare) {
+        $fields[$name] = 1;
+      }
+      
+      CRM_Core_BAO_UFGroup::setProfileDefaults($this->_contactID, $fields, $this->_defaults);
     }
     $stateCountryMap = array();
-    foreach ($this->_fields as $name => $dontcare) {
-      $fields[$name] = 1;
-    }
-
-    CRM_Core_BAO_UFGroup::setProfileDefaults($this->_contactID, $fields, $this->_defaults);
-
     //set custom field defaults
     foreach ($this->_fields as $name => $field) {
       if ($customFieldID = CRM_Core_BAO_CustomField::getKeyID($name)) {