From 1864cfc9839e3926748e6412f5ad674faf1444b1 Mon Sep 17 00:00:00 2001 From: Matthew Wire Date: Tue, 14 Jun 2022 18:53:47 +0100 Subject: [PATCH] Fix PHP notice --- CRM/Contribute/Page/Tab.php | 2 ++ templates/CRM/Contribute/Form/Selector.tpl | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CRM/Contribute/Page/Tab.php b/CRM/Contribute/Page/Tab.php index f8ab5c536e..3cb0cb85bd 100644 --- a/CRM/Contribute/Page/Tab.php +++ b/CRM/Contribute/Page/Tab.php @@ -326,6 +326,8 @@ class CRM_Contribute_Page_Tab extends CRM_Core_Page { private function buildRecurringContributionsArray($recurContributions) { $liveRecurringContributionCount = 0; foreach ($recurContributions as $recurId => $recurDetail) { + // API3 does not return "installments" if it is not set. But we need it set to avoid PHP notices on ContributionRecurSelector.tpl + $recurContributions[$recurId]['installments'] = $recurDetail['installments'] ?? NULL; // Is recurring contribution active? $recurContributions[$recurId]['is_active'] = !in_array(CRM_Contribute_PseudoConstant::contributionStatus($recurDetail['contribution_status_id'], 'name'), CRM_Contribute_BAO_ContributionRecur::getInactiveStatuses()); if ($recurContributions[$recurId]['is_active']) { diff --git a/templates/CRM/Contribute/Form/Selector.tpl b/templates/CRM/Contribute/Form/Selector.tpl index d522a3fc87..29c9490be2 100644 --- a/templates/CRM/Contribute/Form/Selector.tpl +++ b/templates/CRM/Contribute/Form/Selector.tpl @@ -51,7 +51,7 @@ {if $row.amount_level}
({$row.amount_level}){/if} {if $row.contribution_recur_id && $row.is_template}
{ts}(Recurring Template){/ts} - {elseif $row.contribution_recur_id } + {elseif $row.contribution_recur_id}
{ts}(Recurring){/ts} {/if} -- 2.25.1