From 6b7aa000ae91e30e54bfa63b7cffce6c033f6dc4 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Wed, 18 Oct 2023 10:01:07 +1300 Subject: [PATCH] Smarty notice fixes on premium block --- CRM/Contribute/BAO/Premium.php | 3 ++- templates/CRM/Contribute/Form/Contribution/Main.tpl | 2 +- templates/CRM/Contribute/Form/Contribution/PremiumBlock.tpl | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CRM/Contribute/BAO/Premium.php b/CRM/Contribute/BAO/Premium.php index 2f648474de..f79715f40a 100644 --- a/CRM/Contribute/BAO/Premium.php +++ b/CRM/Contribute/BAO/Premium.php @@ -114,6 +114,7 @@ class CRM_Contribute_BAO_Premium extends CRM_Contribute_DAO_Premium { else { CRM_Core_DAO::storeValues($productDAO, $products[$productDAO->id]); } + $products[$productDAO->id] += ['thumbnail' => '', 'image' => '']; } $options = $temp = []; $temp = explode(',', $productDAO->options); @@ -127,10 +128,10 @@ class CRM_Contribute_BAO_Premium extends CRM_Contribute_DAO_Premium { if (count($products)) { $form->assign('showPremium', $formItems); $form->assign('showSelectOptions', $formItems); - $form->assign('products', $products); $form->assign('premiumBlock', $premiumBlock); } } + $form->assign('products', $products ?? NULL); } /** diff --git a/templates/CRM/Contribute/Form/Contribution/Main.tpl b/templates/CRM/Contribute/Form/Contribution/Main.tpl index c6a322673b..520c85da1d 100644 --- a/templates/CRM/Contribute/Form/Contribution/Main.tpl +++ b/templates/CRM/Contribute/Form/Contribution/Main.tpl @@ -183,7 +183,7 @@ {include file="CRM/common/CMSUser.tpl"}
- {include file="CRM/Contribute/Form/Contribution/PremiumBlock.tpl" context="makeContribution"} + {include file="CRM/Contribute/Form/Contribution/PremiumBlock.tpl" context="makeContribution" preview=false}
{if $honoreeProfileFields && $honoreeProfileFields|@count} diff --git a/templates/CRM/Contribute/Form/Contribution/PremiumBlock.tpl b/templates/CRM/Contribute/Form/Contribution/PremiumBlock.tpl index 7077c12d75..309ced9349 100644 --- a/templates/CRM/Contribute/Form/Contribution/PremiumBlock.tpl +++ b/templates/CRM/Contribute/Form/Contribution/PremiumBlock.tpl @@ -114,7 +114,7 @@ {literal}