From: Matthew Wire Date: Tue, 14 Jun 2022 17:53:47 +0000 (+0100) Subject: Fix PHP notice X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=1864cfc9839e3926748e6412f5ad674faf1444b1;p=civicrm-core.git Fix PHP notice --- 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}