From e8f76c16843eaca36fb70eb3b94e2fddd2c83a8a Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Tue, 24 Oct 2023 10:42:18 +1300 Subject: [PATCH] Minor variable consolidation lifetime & pricelifetime both have one function - to trigger the message in the touched tpl. If either are set then effectively both are set. This consolidates them to 1, reducing notices --- CRM/Contribute/Form/Contribution/Main.php | 4 ++-- templates/CRM/Contribute/Form/Contribution/Main.tpl | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CRM/Contribute/Form/Contribution/Main.php b/CRM/Contribute/Form/Contribution/Main.php index be8cbc7bb8..9a94d17b89 100644 --- a/CRM/Contribute/Form/Contribution/Main.php +++ b/CRM/Contribute/Form/Contribution/Main.php @@ -542,7 +542,7 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu } } } - $form->assign('ispricelifetime', $checklifetime); + $form->assign('hasExistingLifetimeMembership', $checklifetime); } /** @@ -688,7 +688,7 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu if ($membership["membership_type_id.duration_unit:name"] === 'lifetime') { unset($radio[$memType['id']]); unset($radioOptAttrs[$memType['id']]); - $this->assign('islifetime', TRUE); + $this->assign('hasExistingLifetimeMembership', TRUE); continue; } $this->assign('renewal_mode', TRUE); diff --git a/templates/CRM/Contribute/Form/Contribution/Main.tpl b/templates/CRM/Contribute/Form/Contribution/Main.tpl index 520c85da1d..33ff5ce7f3 100644 --- a/templates/CRM/Contribute/Form/Contribution/Main.tpl +++ b/templates/CRM/Contribute/Form/Contribution/Main.tpl @@ -66,7 +66,7 @@ {include file="CRM/common/cidzero.tpl"} - {if $isShowMembershipBlock && ($islifetime or $ispricelifetime)} + {if $isShowMembershipBlock && $hasExistingLifetimeMembership}
{ts}You have a current Lifetime Membership which does not need to be renewed.{/ts}
{/if} -- 2.25.1