0

Running into a crazy error that came to me out of the blue. I have a simple page with a few views showing CiviCRM entities.

When I view this page as an administrator, or as the user showing the warning, everything looks and works just fine.

The issue is that the non-administrative users get this blaring error and I can't seem to figure out why...

Any ideas as to what permissions issue this might be?

Cheers!

Warning: in_array() expects parameter 2 to be array, null given in CRM_Event_BAO_Event::checkPermission() (line 2053 of /public_html/sites/all/modules/contrib/civicrm/CRM/Event/BAO/Event.php).
Warning: in_array() expects parameter 2 to be array, null given in CRM_Event_BAO_Event::checkPermission() (line 2053 of /public_html/sites/all/modules/contrib/civicrm/CRM/Event/BAO/Event.php).
Warning: in_array() expects parameter 2 to be array, null given in CRM_Event_BAO_Event::checkPermission() (line 2053 of /public_html/sites/all/modules/contrib/civicrm/CRM/Event/BAO/Event.php).

2 Answers 2

1

This is likely due to trying to pull a view to a user that isn't allowed to see it. Can you restrict access to those views to only the user and admin user so that other users can't see the views?

If that isn't the intensional effect, check the following permissions:

  • views permission (in the views settings)

  • CiviCRM permissions (in People > Permissions on the Drupal side)

  • block permissions (in the block settings)

  • permissions on any custom fields that the view uses (in Drupal or in CiviCRM profiles)
0

Interesting. Thank you for the leads. I went through them all and they were all set to defaults. What ended up fixing my issue was assigning the user role permission:

CiviEvent: access CiviEvent
Create events, view all events, and view participant records (for visible contacts)

In the view in question I was using a PHP field to list all active events, then find all the "parent of" relationships for the currently signed-in user, pulling up their participations, then outputting a list of all the children registered for active events.

I see now that the code runs are the current user. Given that I do not actually want to allow said permissions to that user role, is there any way to have that field "run-as" some other role, rather than provide inordinate power to the user?

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.