Skip to content

Commit

Permalink
check route callback for generating qfkey
Browse files Browse the repository at this point in the history
  • Loading branch information
ufundo committed May 16, 2023
1 parent cfc60da commit 820493f
Showing 1 changed file with 4 additions and 1 deletion.
Expand Up @@ -193,7 +193,10 @@ public function _run(\Civi\Api4\Generic\Result $result) {
// FIXME: tasks() function always checks permissions, should respect `$this->checkPermissions`
foreach (\CRM_Contribute_Task::tasks() as $id => $task) {
if (!empty($task['url'])) {
$key = \CRM_Core_Key::get('CRM_Contribute_Controller_Task', TRUE);
$path = explode('?', $task['url'], 2)[0];
$menu = \CRM_Core_Menu::get($path);
$key = \CRM_Core_Key::get($menu['page_callback'], TRUE);

$tasks[$entity['name']]['contribution.' . $id] = [
'title' => $task['title'],
'icon' => $task['icon'] ?? 'fa-gear',
Expand Down

0 comments on commit 820493f

Please sign in to comment.