Support » Plugin: BP Auto Group Join » Not adding new members

  • I just installed this plugin and selected the option to add new members and also existing members. I updated the settings to this group and none of my members have been added.

    Any pointers?

Viewing 13 replies - 1 through 13 (of 13 total)
  • The same happens to me. Any solution?

    So I’ve been having the same problem and I’ve done some digging.

    The way the plugin works is that it makes a call to group_accept_invite($user_id,$group_id) for each user that it is trying to add. This in turn calls accept_invitation() in the bp-invitation-manager class.

    This method checks if there is an existing invitation in the database and because the plugin has not created one first and is attempting to accept an invitation that doesn’t exist, the following code in accept_invitation() causes the acceptance to fail:

                    if ( ! $this->invitation_exists( $r ) ) {
                            return false;
                    }

    I think if the plugin is updated to create an invitation before it accepts it then the problem will go away. My guess is buddypress has recently got stricter on accepting invitations and previously it worked even if an invitation had not been generated.

    Will see if I can work out a patch/work around until maintainer fixes

    Ok, here is my attempt at a fix. I believe it works fine although no guarantees so backup your databases!

    In bp-auto-group-join-functions.php in the function bp_auto_group_join_all_members() (approx line 12 of file), I’ve updated the code that ‘accepts’ the invite so it instead reads:

                    if( !isset($membership->id) ){
                        // add as member
                        groups_join_group($group_id,$user_id);
                    }

    I believe this bypasses the invite mechanism completely. Also note I changed $member->ID to $member->id as this was a bug that caused every user to be added rather than just the new ones.

    Hope this helps.

    Thread Starter demonboy

    (@demonboy)

    Thanks for your work on this, Toby. I stopped using the plugin in the end as I’ve done away with groups but if I reintroduce them I’ll be sure to try this out. Cheers.

    @tobyrussell – So I’m looking to implement your fix. Do I totally replace line 12 or do I just insert yours?

    Here is the whole function starting on line 12:

    function bp_auto_group_join_all_members( $group_id, $member_types = array() ){
        if( !isset($group_id) || empty($group_id) ) return;
    
            if( isset($member_types) && !empty($member_types) ){
                $all_users = bp_auto_group_join_get_members($member_types);
            }else{
                $all_users = bp_auto_group_join_get_members();
            }
    
            if( isset($all_users) && !empty($all_users) ){
                foreach($all_users as $single){
                    $user_id = $single;
                    // check if already member
                    $membership = new BP_Groups_Member( $user_id, $group_id );
                    if( !isset($membership->ID) ){
                        // add as member
                        groups_accept_invite($user_id, $group_id);
                    }
                }
            }
    }
    

    @tobyrussell @michaelehowe
    Any solution or answer to last question?

    Plugin Support BuddyBoss Support

    (@bbwpsupport)

    Hi Everyone!

    This issue has been forwarded to the development team and will be fixed in our next release.

    Regards

    This is still not working in buddyboss platform 1.4.2

    for those asking for the temp fix,
    1. Replace line 26 to this: if( !isset($membership->id) ){
    2. Replace line 28 to this: groups_join_group($group_id,$user_id);

    Plugin Support BuddyBoss Support

    (@bbwpsupport)

    Hi there!

    Thank you for sharing your fix. We’ll have our developers look into it and get this fixed for our next release.

    Regards.

    Hi There BuddyBoss Support

    Is this plugin supported and when would you be releasing the next update please ?

    It doesn’t add members to the group.

    we set special profile type to be added to group but it didn’t add them. We have 35 users from that kind of profile type, but none of them added.

    @bbwpsupport

    Plugin Support BuddyBoss Support

    (@bbwpsupport)

    Hi,

    @zatakk BP Auto Group Join released v.1.0.4 last October 22.

    @ershadzolfi what Theme are you using? If you have a BuddyBoss account, you can send a ticket to our Support Team via My Account > Tickets, so we can check your concern.

    We tested this on our environment and auto joining on registration and mass joining on Groups > Join Existing Members works fine on our end.

    Regards,
    BuddyBoss Technical Support

Viewing 13 replies - 1 through 13 (of 13 total)
  • You must be logged in to reply to this topic.