christianwach / civicrm-wp-member-sync

CiviCRM WordPress Member Sync plugin keeps a WordPress user in sync with a CiviCRM membership by granting either a role or capabilities to a WordPress user who has that membership.
https://wordpress.org/plugins/civicrm-wp-member-sync/
GNU General Public License v2.0
17 stars 10 forks source link

Getting a Fatal error when Synchronise Login logout is enabled #36

Closed normancates closed 2 years ago

normancates commented 3 years ago

I have a WP install that is relatively fresh. Very minimal until the last month or so when I started working a lot on it.

I installed CiviCRM for a membership site, and installed useful plugins, like this one.

But then when I was logging into the site it gave a severe error.

Fatal error: Uncaught PEAR_Exception: DB Error: unknown error in /home/<WEBDIRECTORY>/public_html/wp-content/plugins/civicrm/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php on line 922  - DB_Error DB Error: unknown error in unknown on line unknown. Exception trace

CRM_Core_Error::exceptionHandler(Object(DB_Error))

/home/<WEBDIRECTORY>/public_html/wp-content/plugins/civicrm/civicrm/vendor/pear/pear-core-minimal/src/PE

 in 

/home/<WEBDIRECTORY>/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php on line 943

I expect that error is less than helpful...

Under "Synchronisation Events" If I turn off "Login and Logout" then the problem goes away. At least for login and logout. Not sure whats going to happen with the other synchronsation events.

Under the Manual Synchronize tab, if I do a manual synchronise it doesn't error out.

Not sure if this is an unfortunate interaction, or something else...

I can reproduce it every time by enabling the "Login and Logout" option in this plugin.

I'm running CivCRM 5.36.0, WP 5.7.1 with all plugins and themes updated to the latest.

(CiviCRM has a .1 update its telling me about, but I don't want to take the time for that right this instant.)

Running MySQL 5.7.34, PHP 7.3.27 on a WHM/Cpanel instance

normancates commented 3 years ago

Update to this: If the user is an administrator, singly or with other roles also assigned, then there is no error.

Possibly related: If the CiviCRM Profile Sync Plugin is active, and a user has a role that allows them to see the Admin bar, but is NOT an administrator, then there is an identical error.

Could this be a permissions thing?

christianwach commented 2 years ago

Closing - not enough info to assess.