From 8171cecab962aee4859ffe3a064c95b42457c72a Mon Sep 17 00:00:00 2001 From: Seamus Lee Date: Fri, 13 Oct 2023 08:43:46 +1100 Subject: [PATCH] [REF] Fix notice error on undefined array key perm --- CRM/Campaign/Form/Survey.php | 1 + CRM/Contribute/Form/ContributionPage.php | 5 +---- CRM/Event/Form/ManageEvent.php | 3 +++ 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CRM/Campaign/Form/Survey.php b/CRM/Campaign/Form/Survey.php index 7b533d4d24..74d1563dad 100644 --- a/CRM/Campaign/Form/Survey.php +++ b/CRM/Campaign/Form/Survey.php @@ -86,6 +86,7 @@ class CRM_Campaign_Form_Survey extends CRM_Core_Form { // CRM-11480, CRM-11682 // Preload libraries required by the "Questions" tab + $this->assign('perm', (bool) CRM_Core_Permission::check('administer CiviCRM')); CRM_UF_Page_ProfileEditor::registerProfileScripts(); CRM_UF_Page_ProfileEditor::registerSchemas(['IndividualModel', 'ActivityModel']); diff --git a/CRM/Contribute/Form/ContributionPage.php b/CRM/Contribute/Form/ContributionPage.php index 28a383d00f..00f843927c 100644 --- a/CRM/Contribute/Form/ContributionPage.php +++ b/CRM/Contribute/Form/ContributionPage.php @@ -85,10 +85,7 @@ class CRM_Contribute_Form_ContributionPage extends CRM_Core_Form { $title = CRM_Core_DAO::getFieldValue('CRM_Contribute_DAO_ContributionPage', $this->_id, 'title'); } - // CRM-16776 - show edit/copy/create buttons on Profiles Tab if user has required permission. - if (CRM_Core_Permission::check('administer CiviCRM')) { - $this->assign('perm', TRUE); - } + $this->assign('perm', (bool) CRM_Core_Permission::check('administer CiviCRM')); // set up tabs CRM_Contribute_Form_ContributionPage_TabHeader::build($this); diff --git a/CRM/Event/Form/ManageEvent.php b/CRM/Event/Form/ManageEvent.php index 10d3018cae..0bd71043f4 100644 --- a/CRM/Event/Form/ManageEvent.php +++ b/CRM/Event/Form/ManageEvent.php @@ -177,6 +177,9 @@ class CRM_Event_Form_ManageEvent extends CRM_Core_Form { if (CRM_Core_Permission::check($checkPermission) || !empty($ufCreate) || !empty($ufEdit)) { $this->assign('perm', TRUE); } + else { + $this->assign('perm', FALSE); + } // also set up tabs CRM_Event_Form_ManageEvent_TabHeader::build($this); -- 2.25.1