Misleading error message about permissions when CiviReport disabled
Overview
If the CiviReport component is disabled (System Settings > Components) and you try to view the result of a completed mailing (Mailings > Scheduled and Sent Mailings > [Choose mailing] > Report > [Various "Report" links]) a misleading error message "You do not have permission to access this page" is displayed. The error log in /wp-content/uploads/civicrm/ConfigAndLog/ shows a fatal error with a CRM_Core_Error::handleUnhandledException but no clue as to the origin.
Reproduction steps
- Disable the CiviReport component at System Settings > Components
- Choose a completed mailing in Mailings > Scheduled and Sent Mailings and click "Report"
- Select any of the "Report" links (e.g. for Click-throughs)
- Error "You do not have permission to access this page" is displayed.
Current behaviour
Error "You do not have permission to access this page" is displayed. Log shows CRM_Core_Error::handleUnhandledException.
Expected behaviour
This exception is nothing to do with permissions - I wasted an hour or so checking all the permissions settings and googling for previous reports and I'm sure I'm not the only one. I was logged in as an Administrator and so permissions shouldn't have been an issue and I wouldn't expect an Administrator or Super User to ever see that message.
I would expect a more informative error message about the disabled CviRules CiviReport component. Even better, the "Report" links could be disabled and replaced with help information if the required component is not enabled. In addition, it should be impossible to disable the component if core functionality depends on it.
Environment information
- Browser: Chrome 89
- CiviCRM: 5.36.0
- PHP: 7.4
- CMS: WordPress 5.7
- Database: MariaDB 10.4.18
- Web Server: Apache 2.4.46