$this->buildComponentForm($this->_id, $this);
- if (!empty($this->_fields) && !empty($this->_values['custom_pre_id'])) {
- $profileAddressFields = array();
- foreach ($this->_fields as $key => $value) {
- CRM_Core_BAO_UFField::assignAddressField($key, $profileAddressFields, array('uf_group_id' => $this->_values['custom_pre_id']));
- }
- $this->set('profileAddressFields', $profileAddressFields);
- }
-
// Build payment processor form
CRM_Core_Payment_ProcessorForm::buildQuickForm($this);
'financial_type' => 1,
);
- $fields = NULL;
- if ($contactID && CRM_Core_BAO_UFGroup::filterUFGroups($id, $contactID)) {
- $fields = CRM_Core_BAO_UFGroup::getFields($id, FALSE, CRM_Core_Action::ADD, NULL, NULL, FALSE,
- NULL, FALSE, NULL, CRM_Core_Permission::CREATE, NULL
- );
- }
- else {
- $fields = CRM_Core_BAO_UFGroup::getFields($id, FALSE, CRM_Core_Action::ADD, NULL, NULL, FALSE,
- NULL, FALSE, NULL, CRM_Core_Permission::CREATE, NULL
- );
- }
+ $fields = CRM_Core_BAO_UFGroup::getFields($id, FALSE, CRM_Core_Action::ADD, NULL, NULL, FALSE,
+ NULL, FALSE, NULL, CRM_Core_Permission::CREATE, NULL
+ );
if ($fields) {
// unset any email-* fields since we already collect it, CRM-2888
$form->_values['cancelSubscriptionUrl'] = $form->_paymentObject->subscriptionURL(NULL, NULL, 'cancel');
}
+ if (!empty($form->_values['custom_pre_id'])) {
+ $profileAddressFields = array();
+ $fields = CRM_Core_BAO_UFGroup::getFields($form->_values['custom_pre_id'], FALSE, CRM_Core_Action::ADD, NULL, NULL, FALSE,
+ NULL, FALSE, NULL, CRM_Core_Permission::CREATE, NULL);
+
+ foreach ((array) $fields as $key => $value) {
+ CRM_Core_BAO_UFField::assignAddressField($key, $profileAddressFields, array('uf_group_id' => $form->_values['custom_pre_id']));
+ }
+ if (count($profileAddressFields)) {
+ $form->set('profileAddressFields', $profileAddressFields);
+ }
+ }
+
//checks after setting $form->_paymentProcessor
// we do this outside of the above conditional to avoid
// saving the country/state list in the session (which could be huge)
*/
public function preProcess() {
parent::preProcess();
+
+ // reload and set values of contributionPage
+ $id = CRM_Utils_Request::retrieve('id', 'Integer');
+ if (!empty($id)) {
+ CRM_Contribute_BAO_ContributionPage::setValues($id, $this->_values);
+ }
+
$this->_paymentProcessorID = CRM_Utils_Request::retrieve('processor_id', 'Integer', CRM_Core_DAO::$_nullObject,
TRUE);
$this->currency = CRM_Utils_Request::retrieve('currency', 'String', CRM_Core_DAO::$_nullObject,