From 97fbc19caf34aa89d8260c22b7df15761e175763 Mon Sep 17 00:00:00 2001 From: larssandergreen Date: Wed, 7 Jun 2023 16:30:26 -0600 Subject: [PATCH] Fix PHP warnings on front end Register --- CRM/Event/Form/Registration.php | 3 +++ CRM/Event/Form/Registration/Register.php | 9 +++++++++ templates/CRM/Event/Form/Registration/Register.tpl | 6 +++--- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/CRM/Event/Form/Registration.php b/CRM/Event/Form/Registration.php index 1a3c1b471d..0719a563cc 100644 --- a/CRM/Event/Form/Registration.php +++ b/CRM/Event/Form/Registration.php @@ -656,6 +656,9 @@ class CRM_Event_Form_Registration extends CRM_Core_Form { if (CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceSet', $priceSetId, 'is_quick_config') && $form->getVar('_name') != 'Participant') { $form->assign('quickConfig', 1); } + else { + $form->assign('quickConfig', 0); + } } // get price info if ($priceSetId) { diff --git a/CRM/Event/Form/Registration/Register.php b/CRM/Event/Form/Registration/Register.php index 3ee42aac91..bc2cb9bec0 100644 --- a/CRM/Event/Form/Registration/Register.php +++ b/CRM/Event/Form/Registration/Register.php @@ -471,6 +471,12 @@ class CRM_Event_Form_Registration_Register extends CRM_Event_Form_Registration { if ($createCMSUser) { CRM_Core_BAO_CMSUser::buildForm($this, $profileID, TRUE); } + else { + $this->assign('showCMS', FALSE); + } + } + else { + $this->assign('showCMS', FALSE); } //we have to load confirm contribution button in template @@ -525,6 +531,9 @@ class CRM_Event_Form_Registration_Register extends CRM_Event_Form_Registration { if ($this->_pcpId) { CRM_PCP_BAO_PCP::buildPcp($this->_pcpId, $this); } + else { + $this->assign('pcp', FALSE); + } } /** diff --git a/templates/CRM/Event/Form/Registration/Register.tpl b/templates/CRM/Event/Form/Registration/Register.tpl index ffde1c06b0..f8c1a325dd 100644 --- a/templates/CRM/Event/Form/Registration/Register.tpl +++ b/templates/CRM/Event/Form/Registration/Register.tpl @@ -43,14 +43,14 @@ {/if} {/crmRegion} - {if $event.intro_text} + {if array_key_exists('intro_text', $event)}

{$event.intro_text}

{/if} {include file="CRM/common/cidzero.tpl"} - {if $pcpSupporterText} + {if $pcp AND $pcpSupporterText}
{$pcpSupporterText}
@@ -144,7 +144,7 @@ {include file="CRM/common/formButtons.tpl" location="bottom"} - {if $event.footer_text} + {if array_key_exists('footer_text', $event)} -- 2.25.1