BuddyDev

Search

[Resolved] Auto Join not working for new users

  • Participant
    Level: Initiated
    Posts: 12
    Raymond Love on #43131

    Created an Auto List so that new users get added automatically to a certain group, based on an Buddypress Extended Profile variable (state where the user is from).
    Then that user gets added automatically to the Group for that state on registration/activation and also on changing their profile.

    it was working good. but not working now.
    When I create a new user, with the right info in the registration process, the new user doesn’t get added to that group.
    HOWEVER, they do get added to the group if I SYNC that Auto List.

    Lastly, I made sure that the Auto Join Group Settings have all three boxes checked on ‘When to apply group lists’.

    Please help.
    Thanks,

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 2908
    Ravi on #43134

    Hello Raymond,

    Sorry for the inconvenience. Please let me know the following things:

    1. Are you using BuddyPress or BuddyBoss Platform?.
    2. If BuddyPress, Are you using youzify plugin?.
    3. As you said it was working previously but not now. Have you recently updated anything because there are chances that the update makes it stop working?
    4. By BuddyPress Extended Profile what you are referring to.
    5. Which registration form you are dealing with.

    Regards
    Ravi

  • Participant
    Level: Initiated
    Posts: 12
    Raymond Love on #43135
    This reply has been marked as private.
  • Participant
    Level: Initiated
    Posts: 12
    Raymond Love on #43136

    Reminder
    When to apply group lists
    1.User account activation
    2.On profile update
    3.On member type change

    All are activated

  • Keymaster
    (BuddyDev Team)
    Posts: 24149
    Brajesh Singh on #43148

    Hi Raymond,
    Thank you.

    I see that your users are registering via WooCommerce. In this case, there are only 2 cases where the action will be applied.

    1. When a user registers
    2. When a user updates their profile

    In the first case(when user registers via WooCommerce), the xprofile data is not available for the user(I still need to look into WooBuddy to verify when they add it). So, only global lists(without any condition will match on this action).

    In case of profile update, xprofile data is available, so it will match any list containing conditions. Please try updating a user’s profile.

    For the 1st case(Registration), Please allow us to check the WooBuddy plugin next week(Monday/Tuesday) and we will have a better idea if we can change our hook’s priority to support it or not.

    Thank you
    Brajesh

  • Participant
    Level: Initiated
    Posts: 12
    Raymond Love on #43159

    Okay. Thank you for your response.
    Then I will wait for next week.
    I found many people are fall in same problem.

    I will appreciate if you fix the issue.

  • Keymaster
    (BuddyDev Team)
    Posts: 24149
    Brajesh Singh on #43167

    Hi Raymond,
    Thank you.

    I will explain the history behind adding support for the registration option and the recent issues being listed on this forum due to it:-

    The plugin is meant primarily for BuddyPress/BuddyBoss where our initial assumption was that users will be going through standard registration/activation process. In that case, when the user activates their account, the xprofile data becomes available and the plugin works as expected.

    The same applies to profile update. It works as the data is available.

    We added support for “Registration” later(Just couple of releases ago) as many people started asking for it. Even when we mentioned that It can only work with global lists(without any condition), It was requested many times.

    The purpose of registration hook is limited to global lists only. The reason is unavailability of xprofile data/member type on ‘user_register’ hook. The plugin needs the xprofile data of the user to be present and set before matching if the condition is applied on xprofile data.

    We regret adding the Registration condition as we have found from the recent topics that admins expect the plugin to match xprofile conditions without knowing that the data may not be available.

    Our current goal is to try and delay the matching of lists on registration, that way even if you are using a 3rd party plugin to set xprofile data, It will become available. The issue with this approach is sites using a redirection plugin will not work if the redirect is called before our attached callback on registration.

    so, for registration, we don’t have a clear cut solution that will work in all cases and if we are unable to communicate that it is only meant for globa lists, we will probably drop it from the plugin to avoid confusion.

    Before we do that, we are also considering using cron job to push the matching/processing in background(after a few seconds). That may resolve the registration problem but it is in very early phase.

    My team or I will update you again in next 2 days after we check WooBuddy to see if there is any shortcut available for now.

    Regards
    Brajesh

  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 2908
    Ravi on #43176

    Hello Raymond,

    Please try the following code:

    
    
    add_action( 'woocommerce_checkout_update_user_meta', function ( $user_id ) {
    
    	if ( ! function_exists( 'bp_auto_join_groups' ) ) {
    		return;
    	}
    
    	$auto_joiner = \BuddyPress_Auto_Join_Groups\Core\Groups_Auto_Joiner::boot();
    
    	$auto_joiner->add_user_to_matching_groups( $user_id );
    }, 100 );
    
    

    Please let me know if it works or not.

    Regards
    Ravi

  • Participant
    Level: Initiated
    Posts: 12
    Raymond Love on #43241
    This reply has been marked as private.
  • Participant
    Level: Initiated
    Posts: 12
    Raymond Love on #43244

    WOW! thanks It’s Working

The topic ‘ [Resolved] Auto Join not working for new users’ is closed to new replies.

This topic is: resolved