From e10fac94e0b3b840d1a5af4feab24f6fb14d6c64 Mon Sep 17 00:00:00 2001 From: Seamus Lee Date: Sun, 6 Jun 2021 02:06:45 +0000 Subject: [PATCH] [php8-compat][REF] Fix some more test failures in php8 --- CRM/Campaign/BAO/Petition.php | 2 ++ CRM/Event/Form/Participant.php | 2 +- CRM/Member/Form/Membership.php | 4 ++++ templates/CRM/common/CMSPrint.tpl | 8 ++++---- templates/CRM/common/accesskeys.tpl | 2 +- templates/CRM/common/joomla.tpl | 4 ++-- templates/CRM/common/status.tpl | 2 +- 7 files changed, 15 insertions(+), 9 deletions(-) diff --git a/CRM/Campaign/BAO/Petition.php b/CRM/Campaign/BAO/Petition.php index 72e2151a64..a13450f148 100644 --- a/CRM/Campaign/BAO/Petition.php +++ b/CRM/Campaign/BAO/Petition.php @@ -576,6 +576,8 @@ AND tag_id = ( SELECT id FROM civicrm_tag WHERE name = %2 )"; // tokens then available in msg template as {$petition.title}, etc $petitionTokens['title'] = $petitionInfo['title']; $petitionTokens['petitionId'] = $params['sid']; + $tplParams['survey_id'] = $params['sid']; + $tplParams['petitionTitle'] = $petitionInfo['title']; $tplParams['petition'] = $petitionTokens; switch ($sendEmailMode) { diff --git a/CRM/Event/Form/Participant.php b/CRM/Event/Form/Participant.php index 36d065acd1..951c2e0536 100644 --- a/CRM/Event/Form/Participant.php +++ b/CRM/Event/Form/Participant.php @@ -1360,7 +1360,7 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment } // also store lineitem stuff here - if ((($this->_lineItem & $this->_action & CRM_Core_Action::ADD) || + if ((($this->_lineItem && $this->_action & CRM_Core_Action::ADD) || ($this->_lineItem && CRM_Core_Action::UPDATE && !$this->_paymentId)) ) { foreach ($this->_contactIds as $num => $contactID) { diff --git a/CRM/Member/Form/Membership.php b/CRM/Member/Form/Membership.php index 1b897280df..fb53ee2101 100644 --- a/CRM/Member/Form/Membership.php +++ b/CRM/Member/Form/Membership.php @@ -945,6 +945,10 @@ DESC limit 1"); if (!empty($formValues['contribution_id'])) { $form->assign('contributionID', $formValues['contribution_id']); + $form->assign('currency', CRM_Core_DAO::getFieldValue('CRM_Contribute_DAO_Contribution', $formValues['contribution_id'], 'currency')); + } + else { + $form->assign('currency', CRM_Core_Config::singleton()->defaultCurrency); } if (!empty($formValues['contribution_status_id'])) { diff --git a/templates/CRM/common/CMSPrint.tpl b/templates/CRM/common/CMSPrint.tpl index 9edb297aba..33e55d1636 100644 --- a/templates/CRM/common/CMSPrint.tpl +++ b/templates/CRM/common/CMSPrint.tpl @@ -11,9 +11,9 @@ {include file="CRM/common/debug.tpl"} {/if} -
+
-{if $breadcrumb} +{if !empty($breadcrumb)} {/if} -{if $pageTitle} +{if !empty($pageTitle)}

{if $isDeleted}{/if}{$pageTitle}{if $isDeleted}{/if}

@@ -49,7 +49,7 @@
{crmRegion name='page-footer'} -{if $urlIsPublic} +{if !empty($urlIsPublic)} {include file="CRM/common/publicFooter.tpl"} {else} {include file="CRM/common/footer.tpl"} diff --git a/templates/CRM/common/accesskeys.tpl b/templates/CRM/common/accesskeys.tpl index 73bb66288e..21541aebd9 100644 --- a/templates/CRM/common/accesskeys.tpl +++ b/templates/CRM/common/accesskeys.tpl @@ -7,7 +7,7 @@ | and copyright information, see https://civicrm.org/licensing | +--------------------------------------------------------------------+ *} -{if not $urlIsPublic} +{if empty($urlIsPublic)}