Skip to content

Commit

Permalink
Fix civicrm#613 - Ensure 'org.civicrm.volunteer' exists
Browse files Browse the repository at this point in the history
  • Loading branch information
colemanw authored and jmcclelland committed Sep 17, 2024
1 parent 5bcaa1f commit c710670
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 19 deletions.
3 changes: 3 additions & 0 deletions CRM/Volunteer/Page/Angular.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down
19 changes: 0 additions & 19 deletions volunteer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c710670

Please sign in to comment.