[REF] Fix notice error on undefined array key perm
authorSeamus Lee <seamuslee001@gmail.com>
Thu, 12 Oct 2023 21:43:46 +0000 (08:43 +1100)
committerSeamus Lee <seamuslee001@gmail.com>
Thu, 12 Oct 2023 21:45:24 +0000 (08:45 +1100)
CRM/Campaign/Form/Survey.php
CRM/Contribute/Form/ContributionPage.php
CRM/Event/Form/ManageEvent.php

index 7b533d4d24f1f2b1c28bc84dd5a79f5de7aa08d3..74d1563dad45d4bb65bf97693d056efc709bb7b5 100644 (file)
@@ -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']);
 
index 28a383d00f52c25e5971084f6cdabff2644bbbe0..00f843927cc3b7e13cf901aa80e5946d3fe2a9d3 100644 (file)
@@ -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);
 
index 10d3018caecad18c0d5e7f81fb11d7e3a322d11c..0bd71043f425660d0197889599778f3ac9ea2b87 100644 (file)
@@ -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);