From 23f64d959c462c7d8b8cf7ad6663d7f8102feba1 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Mon, 21 Mar 2022 10:38:05 +1300 Subject: [PATCH] Fix smarty notices in billing form Per New membership page --- CRM/Core/Payment/Form.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/CRM/Core/Payment/Form.php b/CRM/Core/Payment/Form.php index b6e32e52ca..ee37b26c00 100644 --- a/CRM/Core/Payment/Form.php +++ b/CRM/Core/Payment/Form.php @@ -116,7 +116,7 @@ class CRM_Core_Payment_Form { // This will cause the fields to be marked as required - but it is up to the payment processor to // validate it. $requiredPaymentFields[$field['name']] = $field['is_required']; - $paymentFieldsMetadata[$field['name']] = $field; + $paymentFieldsMetadata[$field['name']] = array_merge(['description' => ''], $field); } $form->assign('paymentFieldsMetadata', $paymentFieldsMetadata); @@ -214,11 +214,8 @@ class CRM_Core_Payment_Form { */ public static function buildPaymentForm(&$form, $processor, $billing_profile_id, $isBackOffice, $paymentInstrumentID = NULL) { //if the form has address fields assign to the template so the js can decide what billing fields to show - $profileAddressFields = $form->get('profileAddressFields'); - if (!empty($profileAddressFields)) { - $form->assign('profileAddressFields', $profileAddressFields); - } - + $form->assign('profileAddressFields', $form->get('profileAddressFields') ?? NULL); + $form->addExpectedSmartyVariable('suppressSubmitButton'); if (!empty($processor['object']) && $processor['object']->buildForm($form)) { return; } -- 2.25.1