From: Eileen McNaughton Date: Mon, 3 Nov 2014 10:18:36 +0000 (+1300) Subject: CRM-15555 fix front end form to use byProcessor method rather than type X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=3392cb1702fe3bd3f070896e83c8d15a4a05e1ee;p=civicrm-core.git CRM-15555 fix front end form to use byProcessor method rather than type --- diff --git a/CRM/Core/Payment/Form.php b/CRM/Core/Payment/Form.php index 12cc966b29..f770737e35 100644 --- a/CRM/Core/Payment/Form.php +++ b/CRM/Core/Payment/Form.php @@ -54,7 +54,7 @@ class CRM_Core_Payment_Form { /** * Add payment fields are depending on payment processor * - * @param CRM_Contribute_Form_Contribution $form + * @param CRM_Contribute_Form_Contribution| CRM_Contribute_Form_Contribution_Main $form * @todo - add other forms specifically to the definition - since we don't have for $form - since we aren't adding the property to * CRM_Core_Form (don't suppose we should?) * @param array $processor array of properties including 'object' as loaded from CRM_Financial_BAO_PaymentProcessor::getPaymentProcessors diff --git a/CRM/Core/Payment/ProcessorForm.php b/CRM/Core/Payment/ProcessorForm.php index 3f63056575..3f2394be24 100644 --- a/CRM/Core/Payment/ProcessorForm.php +++ b/CRM/Core/Payment/ProcessorForm.php @@ -68,10 +68,8 @@ class CRM_Core_Payment_ProcessorForm { //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) + CRM_Core_Payment_Form::setPaymentFieldsByProcessor($form, $form->_paymentProcessor); - if (($form->_paymentProcessor['billing_mode'] & CRM_Core_Payment::BILLING_MODE_FORM) && !empty($form->_values['is_monetary'])) { - CRM_Core_Payment_Form::setPaymentFieldsByType($form->_paymentProcessor['payment_type'], $form); - } $form->assign_by_ref('paymentProcessor', $form->_paymentProcessor); diff --git a/CRM/Financial/BAO/PaymentProcessor.php b/CRM/Financial/BAO/PaymentProcessor.php index fb42a37414..b673f59dbb 100644 --- a/CRM/Financial/BAO/PaymentProcessor.php +++ b/CRM/Financial/BAO/PaymentProcessor.php @@ -269,7 +269,7 @@ class CRM_Financial_BAO_PaymentProcessor extends CRM_Financial_DAO_PaymentProces $fields = array( 'id', 'name', 'payment_processor_type_id', 'user_name', 'password', 'signature', 'url_site', 'url_api', 'url_recur', 'url_button', - 'subject', 'class_name', 'is_recur', 'billing_mode', + 'subject', 'class_name', 'is_recur', 'billing_mode', 'is_test', 'payment_type', 'is_default', ); $result = array(); @@ -278,7 +278,7 @@ class CRM_Financial_BAO_PaymentProcessor extends CRM_Financial_DAO_PaymentProces } $result['payment_processor_type'] = CRM_Core_PseudoConstant::paymentProcessorType(FALSE, $dao->payment_processor_type_id, 'name'); - $result['instance'] =& CRM_Core_Payment::singleton($mode, $result); + $result['instance'] = $result['object'] =& CRM_Core_Payment::singleton($mode, $result); return $result; }