1

We have a team member who helps us set up events. We have just upgraded to CiviCRM 5.68.1 on Drupal 7. This error has cropped up only since our upgrade.

This team member has the following permissions:

  • CiviCRM: skip IDS check
  • CiviCRM: access CiviCRM backend and API
  • CiviEvent: access CiviEvent
  • CiviEvent: edit event participants
  • CiviEvent: edit all events
  • CiviEvent: register for events
  • CiviEvent: view event info

Notably, they do not have "Administer CiviCRM" since they should only be in here helping us with event creation and management.

When this user clicks to edit an event reminder, we get the following error in the log:

2024-01-15 15:30:56-0800  [debug] $API Request Authorization failed = #0 /var/www/html/sites/all/modules/civicrm/Civi/API/Kernel.php(151): CRM_Core_Error::backtrace("API Request Authorization failed", TRUE)
#1 /var/www/html/sites/all/modules/civicrm/Civi/Api4/Generic/AbstractAction.php(256): Civi\API\Kernel->runRequest(Object(Civi\Api4\Generic\DAOGetAction))
#2 /var/www/html/sites/all/modules/civicrm/api/api.php(91): Civi\Api4\Generic\AbstractAction->execute()
#3 /var/www/html/sites/all/modules/civicrm/CRM/Admin/Form.php(161): civicrm_api4("ActionSchedule", "get", (Array:1))
#4 /var/www/html/sites/all/modules/civicrm/CRM/Admin/Form.php(77): CRM_Admin_Form->retrieveValues()
#5 /var/www/html/sites/all/modules/civicrm/CRM/Admin/Form/ScheduleReminders.php(50): CRM_Admin_Form->preProcess()
#6 /var/www/html/sites/all/modules/civicrm/CRM/Core/Form.php(717): CRM_Admin_Form_ScheduleReminders->preProcess()
#7 /var/www/html/sites/all/modules/civicrm/CRM/Core/QuickForm/Action/Display.php(76): CRM_Core_Form->buildForm()
#8 /var/www/html/sites/all/modules/civicrm/packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Display->perform(Object(CRM_Admin_Form_ScheduleReminders), "display")
#9 /var/www/html/sites/all/modules/civicrm/packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller->handle(Object(CRM_Admin_Form_ScheduleReminders), "display")
#10 /var/www/html/sites/all/modules/civicrm/CRM/Core/Controller.php(355): HTML_QuickForm_Page->handle("display")
#11 /var/www/html/sites/all/modules/civicrm/CRM/Utils/Wrapper.php(98): CRM_Core_Controller->run()
#12 /var/www/html/sites/all/modules/civicrm/CRM/Core/Invoke.php(295): CRM_Utils_Wrapper->run("CRM_Admin_Form_ScheduleReminders", "Schedule Reminders", (Array:0))
#13 /var/www/html/sites/all/modules/civicrm/CRM/Core/Invoke.php(69): CRM_Core_Invoke::runItem((Array:17))
#14 /var/www/html/sites/all/modules/civicrm/CRM/Core/Invoke.php(36): CRM_Core_Invoke::_invoke((Array:4))
#15 /var/www/html/sites/all/modules/civicrm/drupal/civicrm.module(472): CRM_Core_Invoke::invoke((Array:4))
#16 /var/www/html/includes/menu.inc(527): civicrm_invoke("admin", "scheduleReminders", "edit")
#17 /var/www/html/index.php(21): menu_execute_active_handler()
#18 {main}


2024-01-15 15:30:56-0800  [error]
$Fatal Error Details = array:3 [
  "message" => "Authorization failed"
  "code" => null
  "exception" => Civi\API\Exception\UnauthorizedException {#2401
    -errorData: array:1 [
      "error_code" => "unauthorized"
    ]
    #cause: null
    -_trace: null
    #message: "Authorization failed"
    #code: 0
    #file: "/var/www/html/sites/all/modules/civicrm/Civi/API/Kernel.php"
    #line: 230
    trace: {
      /var/www/html/sites/all/modules/civicrm/Civi/API/Kernel.php:230 {
        Civi\API\Kernel->authorize($apiProvider, $apiRequest)
        › if (!$event->isAuthorized()) {
        ›   throw new \Civi\API\Exception\UnauthorizedException("Authorization failed");
        › }
      }
      /var/www/html/sites/all/modules/civicrm/Civi/API/Kernel.php:147 { …}
      /var/www/html/sites/all/modules/civicrm/Civi/Api4/Generic/AbstractAction.php:256 { …}
      /var/www/html/sites/all/modules/civicrm/api/api.php:91 { …}
      /var/www/html/sites/all/modules/civicrm/CRM/Admin/Form.php:161 { …}
      /var/www/html/sites/all/modules/civicrm/CRM/Admin/Form.php:77 { …}
      /var/www/html/sites/all/modules/civicrm/CRM/Admin/Form/ScheduleReminders.php:50 { …}
      /var/www/html/sites/all/modules/civicrm/CRM/Core/Form.php:717 { …}
      /var/www/html/sites/all/modules/civicrm/CRM/Core/QuickForm/Action/Display.php:76 { …}
      /var/www/html/sites/all/modules/civicrm/packages/HTML/QuickForm/Controller.php:203 { …}
      /var/www/html/sites/all/modules/civicrm/packages/HTML/QuickForm/Page.php:103 { …}
      /var/www/html/sites/all/modules/civicrm/CRM/Core/Controller.php:355 { …}
      /var/www/html/sites/all/modules/civicrm/CRM/Utils/Wrapper.php:98 { …}
      /var/www/html/sites/all/modules/civicrm/CRM/Core/Invoke.php:295 { …}
      /var/www/html/sites/all/modules/civicrm/CRM/Core/Invoke.php:69 { …}
      /var/www/html/sites/all/modules/civicrm/CRM/Core/Invoke.php:36 { …}
      /var/www/html/sites/all/modules/civicrm/drupal/civicrm.module:472 { …}
      /var/www/html/includes/menu.inc:527 { …}
      /var/www/html/index.php:21 { …}
    }
  }
]


2024-01-15 15:30:56-0800  [debug] $backTrace = #0 /var/www/html/sites/all/modules/civicrm/CRM/Core/Error.php(443): CRM_Core_Error::backtrace("backTrace", TRUE)
#1 /var/www/html/sites/all/modules/civicrm/CRM/Core/Invoke.php(39): CRM_Core_Error::handleUnhandledException(Object(Civi\API\Exception\UnauthorizedException))
#2 /var/www/html/sites/all/modules/civicrm/drupal/civicrm.module(472): CRM_Core_Invoke::invoke((Array:4))
#3 /var/www/html/includes/menu.inc(527): civicrm_invoke("admin", "scheduleReminders", "edit")
#4 /var/www/html/index.php(21): menu_execute_active_handler()
#5 {main}

Strangely, they can create new scheduled reminders on events no problem. But they then cannot edit the event scheduled reminder, not even for reminders they themselves created.

I don't see any permissions related to scheduled reminders so I'm not sure what permission to grant them.

This team member was able to create & edit event schedule reminders no problem in our prior version of Civi which...I forget the exact version number but we last upgraded about a year ago.

I tried reproducing this on dmaster but I don't see a way to create a new Drupal user in dmaster with specific permissions.

Is this a bug that I should report against core in gitlab, or something else?

Thank you!

1 Answer 1

0

Upgrading CiviCRM from 5.69.3 to 5.69.5 fixed this issue for us.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.