From 5c0de104bf8c1289d02dee7164f3bf5c4112fa5c Mon Sep 17 00:00:00 2001 From: Bradley Taylor Date: Sat, 29 Jan 2022 15:54:19 +0000 Subject: [PATCH] Avoid PHP notice on 'Manage Contribution Pages' screen --- CRM/Contribute/Page/ContributionPage.php | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/CRM/Contribute/Page/ContributionPage.php b/CRM/Contribute/Page/ContributionPage.php index ebb64417a5..23d8536c9c 100644 --- a/CRM/Contribute/Page/ContributionPage.php +++ b/CRM/Contribute/Page/ContributionPage.php @@ -456,9 +456,10 @@ ORDER BY is_active desc, title asc //get configure actions links. $configureActionLinks = self::configureActionLinks(); + $contributions = []; while ($dao->fetch()) { - $contribution[$dao->id] = []; - CRM_Core_DAO::storeValues($dao, $contribution[$dao->id]); + $contributions[$dao->id] = []; + CRM_Core_DAO::storeValues($dao, $contributions[$dao->id]); // form all action links $action = array_sum(array_keys(self::actionLinks())); @@ -486,7 +487,7 @@ ORDER BY is_active desc, title asc //build the configure links. $sectionsInfo = CRM_Utils_Array::value($dao->id, $contriPageSectionInfo, []); - $contribution[$dao->id]['configureActionLinks'] = CRM_Core_Action::formLink(self::formatConfigureLinks($sectionsInfo), + $contributions[$dao->id]['configureActionLinks'] = CRM_Core_Action::formLink(self::formatConfigureLinks($sectionsInfo), $action, array('id' => $dao->id), ts('Configure'), @@ -497,7 +498,7 @@ ORDER BY is_active desc, title asc ); //build the contributions links. - $contribution[$dao->id]['contributionLinks'] = CRM_Core_Action::formLink(self::contributionLinks(), + $contributions[$dao->id]['contributionLinks'] = CRM_Core_Action::formLink(self::contributionLinks(), $action, array('id' => $dao->id), ts('Contributions'), @@ -508,7 +509,7 @@ ORDER BY is_active desc, title asc ); //build the online contribution links. - $contribution[$dao->id]['onlineContributionLinks'] = CRM_Core_Action::formLink(self::onlineContributionLinks(), + $contributions[$dao->id]['onlineContributionLinks'] = CRM_Core_Action::formLink(self::onlineContributionLinks(), $action, array('id' => $dao->id), ts('Links'), @@ -519,7 +520,7 @@ ORDER BY is_active desc, title asc ); //build the normal action links. - $contribution[$dao->id]['action'] = CRM_Core_Action::formLink(self::actionLinks(), + $contributions[$dao->id]['action'] = CRM_Core_Action::formLink(self::actionLinks(), $action, array('id' => $dao->id), ts('more'), @@ -530,12 +531,10 @@ ORDER BY is_active desc, title asc ); //show campaigns on selector. - $contribution[$dao->id]['campaign'] = $allCampaigns[$dao->campaign_id] ?? NULL; + $contributions[$dao->id]['campaign'] = $allCampaigns[$dao->campaign_id] ?? NULL; } - if (isset($contribution)) { - $this->assign('rows', $contribution); - } + $this->assign('rows', $contributions); } public function search() { -- 2.25.1