From c710670d37b0da303d5dc3d413b1881dc617ec01 Mon Sep 17 00:00:00 2001 From: colemanw Date: Mon, 16 Sep 2024 19:37:28 -0400 Subject: [PATCH] Fix #613 - Ensure 'org.civicrm.volunteer' exists --- CRM/Volunteer/Page/Angular.php | 3 +++ volunteer.php | 19 ------------------- 2 files changed, 3 insertions(+), 19 deletions(-) diff --git a/CRM/Volunteer/Page/Angular.php b/CRM/Volunteer/Page/Angular.php index 94740a48..7057813b 100644 --- a/CRM/Volunteer/Page/Angular.php +++ b/CRM/Volunteer/Page/Angular.php @@ -7,6 +7,9 @@ public function run() { 'template' => 'CRM/common/notifications.tpl', )); CRM_Volunteer_Angular::load('/volunteer/manage'); + // Ensure this setting exists even if it's an empty object (https://github.com/civicrm/org.civicrm.volunteer/issues/613) + Civi::resources() + ->addVars('org.civicrm.volunteer', []); parent::run(); } diff --git a/volunteer.php b/volunteer.php index f83bc8df..00d93be3 100644 --- a/volunteer.php +++ b/volunteer.php @@ -492,25 +492,6 @@ function _volunteer_isVolListingApiCall($entity, $action) { return (in_array($entity, $entities) && in_array($action, $actions)); } -/** - * Implements hook_civicrm_angularModules(). - * - * @param array $angularModules - * An array containing a list of all Angular modules. - */ -function volunteer_civicrm_angularModules(&$angularModules) { - - // DEPRECATED clientside variable CRM.vars['org.civicrm.volunteer'].currentContactId - // Not used by this extension but kept around in case others depend on it. - // They should be updated to use CRM.config.cid - CRM_Core_Resources::singleton() - ->addVars('org.civicrm.volunteer', array( - 'currentContactId' => CRM_Core_Session::singleton()->getLoggedInContactID() - )); - - return; -} - /** * This is an implementation of hook_civicrm_fieldOptions * It includes `civicrm_volunteer_project` in the whitelist