JMAConsulting / biz.jmaconsulting.activitytypeacl

This extension provides the ability to restrict activities on CiviCRM by roles with permissions to various activity types.
GNU Affero General Public License v3.0
4 stars 3 forks source link

Extension causes all contact pages to give a 500 error on Civi 5.13+ #4

Closed MegaphoneJon closed 5 years ago

MegaphoneJon commented 5 years ago

Error and stack trace are below. Interestingly, my initial research suggests this is an issue on PHP 7.1+ but this site runs PHP 7.0.33.

This client isn't actually using this extension so I disabled it. I don't think I have any other users, but if I do I'll try to step through this with a debugger.

[Mon May 06 12:04:22.859812 2019] [:error] [pid 12353] [client 69.122.131.116:53662] PHP Fatal error:  Uncaught Error: [] operator not supported for strings in /var/www/nwu.org/wp-content/civicrm-custom/ext/biz.jmaconsulting.activitytypeacl/activitytypeacl.php:313
Stack trace:
#0 /var/www/nwu.org/wp-content/plugins/civicrm/civicrm/CRM/Utils/Hook.php(290): activitytypeacl_civicrm_selectWhereClause('Activity', Array)
#1 /var/www/nwu.org/wp-content/plugins/civicrm/civicrm/CRM/Utils/Hook/WordPress.php(155): CRM_Utils_Hook->runHooks(Array, 'civicrm_selectW...', 2, 'Activity', Array, NULL, NULL, NULL, NULL)
#2 /var/www/nwu.org/wp-content/plugins/civicrm/civicrm/Civi/Core/CiviEventDispatcher.php(90): CRM_Utils_Hook_WordPress->invokeViaUF(2, 'Activity', Array, NULL, NULL, NULL, NULL, 'civicrm_selectW...')
#3 /var/www/nwu.org/wp-content/plugins/civicrm/civicrm/vendor/symfony/event-dispatcher/EventDispatcher.php(184): Civi\\Core\\CiviEventDispatcher::delegateToUF(Object(Civi\\Core\\Event\\GenericHookEvent), 'hook_civicrm_se...', Object(Civi\\Core\\CiviEventDispatcher))
#4 /var/www/nwu.org/wp-content/plugins/civicrm/civicrm/ven in /var/www/nwu.org/wp-content/civicrm-custom/ext/biz.jmaconsulting.activitytypeacl/activitytypeacl.php on line 313, referer: https://nwu.org/wp-admin/admin.php?page=CiviCRM
JoeMurray commented 5 years ago

@monish please treat as urgent. Tahnks @MegaphoneJon

clarkac1 commented 5 years ago

In 5.13.1 I got the following error when going to the contact summary screen. Same problem as above? Using PHP 7.2.17 _"Error: [] operator not supported for strings in activitytypeacl_civicrm_selectWhereClause() (line 423 of /home/powyscon/publichtml/acivi.org.uk/sites/default/files/civicrm/ext/biz.jmaconsulting.activitytypeacl-master/activitytypeacl.php)."

Edzelopez commented 5 years ago

Hi @MegaphoneJon and @clarkac1

I've fixed this in the latest commit https://github.com/JMAConsulting/biz.jmaconsulting.activitytypeacl/commit/487253a3325049304ed5fa56e79a9fc3e038124b

Could you please try applying the patch and let me know if all looks good?

clarkac1 commented 5 years ago

I installed the latest version and the problem I found is fixed, thanks. This is with Civi 5.13.1

Edzelopez commented 5 years ago

Hi @MegaphoneJon! Could you please confirm if the latest patch fixes your issue?

MegaphoneJon commented 5 years ago

Hi @Edzelopez - I just installed it on a local copy and confirmed it's fixed. Note that since I'm not running this extension anywhere (I installed it for a project that never went forward and forgot to disable it) that I can't speak to side effects.