X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FPCP%2FForm%2FPCPAccount.php;h=9708f33b557e0e3cdcbdea72f70cde8e15ec0d83;hb=9d9922e715d8f941465f61fa2206bc3867a99f01;hp=81acc9083c155dd65a166ca0d972ae644b6763de;hpb=764a953832bacc81025589ee0e864d4d01a706a8;p=civicrm-core.git diff --git a/CRM/PCP/Form/PCPAccount.php b/CRM/PCP/Form/PCPAccount.php index 81acc9083c..9708f33b55 100644 --- a/CRM/PCP/Form/PCPAccount.php +++ b/CRM/PCP/Form/PCPAccount.php @@ -56,6 +56,15 @@ class CRM_PCP_Form_PCPAccount extends CRM_Core_Form { */ public $_single; + /** + * the default values for the form + * + * @var array + * @protected + */ + protected $_defaults; + + public function preProcess() { $session = CRM_Core_Session::singleton(); $config = CRM_Core_Config::singleton(); @@ -108,11 +117,12 @@ class CRM_PCP_Form_PCPAccount extends CRM_Core_Form { } function setDefaultValues() { + $this->_defaults = array(); if ($this->_contactID) { foreach ($this->_fields as $name => $dontcare) { $fields[$name] = 1; } - + CRM_Core_BAO_UFGroup::setProfileDefaults($this->_contactID, $fields, $this->_defaults); } $stateCountryMap = array(); @@ -177,7 +187,9 @@ class CRM_PCP_Form_PCPAccount extends CRM_Core_Form { } CRM_Core_BAO_UFGroup::buildProfile($this, $field, CRM_Profile_Form::MODE_CREATE); $this->_fields[$key] = $field; - if ($field['add_captcha']) { + + // CRM-11316 Is ReCAPTCHA enabled for this profile AND is this an anonymous visitor + if ($field['add_captcha'] && !$this->_contactID) { $addCaptcha = TRUE; } } @@ -283,7 +295,7 @@ class CRM_PCP_Form_PCPAccount extends CRM_Core_Form { if ($ids) { $this->_contactID = $ids['0']; } - $contactID = &CRM_Contact_BAO_Contact::createProfileContact($params, $this->_fields, $this->_contactID); + $contactID = CRM_Contact_BAO_Contact::createProfileContact($params, $this->_fields, $this->_contactID); $this->set('contactID', $contactID); if (!empty($params['email'])) {