Details
-
Type: Bug
-
Status: Done/Fixed
-
Priority: Minor
-
Resolution: Duplicate
-
Affects Version/s: 4.7.4
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
-
Documentation Required?:None
-
Funding Source:Needs Funding
Description
See http://civicrm.stackexchange.com/questions/10711/why-cant-i-access-option-groups.
I replicated this on one 4.7.4 instance but not another; I'm not 100% sure why it works in one case, but I know why it does NOT work.
CRM_Core_Page_Basic->action calls CRM_Case_BAO_Case::caseCount (line 294). Due to CRM-17645, caseCount now requires a CiviCase permission - but CiviCase might not even be enabled. It fails with the backtrace/error posted on SE.
It reveals a second relatively minor bug though: \Civi\Api\Subscriber\PermissionCheck->onApiAuthorize has a line:
{{ $permissions = implode(' and ', $permissions);}}
That should (maybe) be:
{{ $permissions = implode(' and ', $permissions[0]);}}
That will change the error to:
insufficient permission: access my cases and activities and access all cases and activities
instead of:
insufficient permission: Array
I'm not 100% sure how to handle the permissions issue. This seems like a hack-in-a-hack, but a permission check on the appropriate permissions before calling `caseCount` is in order.
Attachments
Issue Links
- supplements
-
CRM-18456 CRM-17645 breaks Activity screen when CiviCase is enabled
- Done/Fixed