tobyrussell
Forum Replies Created
-
Forum: Plugins
In reply to: [BP Auto Group Join] Not adding new membersOk, 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.
Forum: Plugins
In reply to: [BP Auto Group Join] Not adding new membersSo 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