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

Error after registering first time and syncing single user #14

Closed nc3man closed 8 years ago

nc3man commented 8 years ago

If I may refer you to the complete discussion, please go to: http://civicrm.stackexchange.com/questions/15189/automatically-sync-new-wordpress-registrant-to-civicrm-contact

For Settings, Method=Capabilities, Synchronization Events=Login and Logout ONLY. Just one Association Rule: Civi-Membership Type=Individual; Current Codes=Pending; Expired Codes=Grace; Membership Capability=civimember_1

Thanks for any help.

nc3man commented 8 years ago

Here is a more readable form of the error message:

Warning: Missing argument 2 for Civi_WP_Member_Sync_Members::sync_to_user() in /home/karrud1/sdbikecoalition/wp-content/plugins/civicrm-wp-member-sync/civi-wp-ms-members.php on line 352

Warning: Cannot modify header information - headers already sent by (output started at /home/karrud1/sdbikecoalition/wp-content/plugins/civicrm-wp-member-sync/civi-wp-ms-members.php:352) in /home/karrud1/sdbikecoalition/wp-includes/pluggable.php on line 1174
christianwach commented 8 years ago

@nc3man Have you checked whether this is a conflict with another plugin? Try switching them off (particularly any login-related plugins) in turn and see if the warning persists. The warning is triggered by a callback method which properly accepts two parameters from the wp_login action. My guess would be that you have another plugin calling do_action( 'wp_login' ) with the wrong number of parameters.

nc3man commented 8 years ago

That's good news. Being new to both Wordpress and CiviCRM, I grabbed these plugins as there didn't seem to be a way to register and login a WP user: To register a new user on the page I installed the plugin "WP Register Profile With Shortcode" and to display a login dialog on the page (once registered), I installed the plugin "Login Widget With Shortcode." I configured the Register plugin to also immediately login after registering. I can grab others. To save me time guessing, do you recommend a WP plugin that handles both the registration and login, where the user is directed to register if they've never logged in?

nc3man commented 8 years ago

So, if I just put in a link to call wp-login.php directly from my page instead of using a widget, all works perfectly as expected. I'll keep it simple and not use plugins to do the job. The standard wp-login.php handles login, register, and forgot password, so I will just embed that in a page. Is that what most folks do, or is there really some recommended plugin that does it better?

christianwach commented 8 years ago

Personally, I use the BuddyPress xProfile component to handle this, but it requires a few additional plugins to work properly with CiviCRM, specifically the addition of CiviCRM WordPress Profile Sync and BP xProfile WordPress User Sync. I'd recommend CiviCRM WordPress Profile Sync whether you use BuddyPress or not.