From 58025217985f3c8cfc51b82f0b3b1195030cc0d3 Mon Sep 17 00:00:00 2001 From: Pradeep Nayak Date: Thu, 23 Mar 2017 19:54:24 +0530 Subject: [PATCH] CRM-20334, some times payment object is not set and is protected variable ---------------------------------------- * CRM-20334: Fatal Error on Submit Credit Card Form https://issues.civicrm.org/jira/browse/CRM-20334 --- CRM/Contribute/Form/Contribution/Main.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/CRM/Contribute/Form/Contribution/Main.php b/CRM/Contribute/Form/Contribution/Main.php index 293c3ced01..f3cfc33270 100644 --- a/CRM/Contribute/Form/Contribution/Main.php +++ b/CRM/Contribute/Form/Contribution/Main.php @@ -566,11 +566,13 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu $form->assign('is_recur_interval', CRM_Utils_Array::value('is_recur_interval', $form->_values)); $form->assign('is_recur_installments', CRM_Utils_Array::value('is_recur_installments', $form->_values)); - - $form->assign('recurringHelpText', $form->_paymentObject->getText('contributionPageRecurringHelp', array( - 'is_recur_installments' => !empty($form->_values['is_recur_installments']), - 'is_email_receipt' => !empty($form->_values['is_email_receipt']), - ))); + $paymentObject = $form->getVar('_paymentObject'); + if ($paymentObject) { + $form->assign('recurringHelpText', $paymentObject->getText('contributionPageRecurringHelp', array( + 'is_recur_installments' => !empty($form->_values['is_recur_installments']), + 'is_email_receipt' => !empty($form->_values['is_email_receipt']), + ))); + } $form->add('checkbox', 'is_recur', ts('I want to contribute this amount'), NULL); -- 2.25.1