Bug #2086

Groups > Invitations reads "No Pending Invites" even when there are

Added by Boone Gorges about 9 years ago. Updated almost 9 years ago.

Priority name:
Category name:
BuddyPress (misc)
Target version:
Start date:
Due date:
% Done:


Estimated time:


From a user report:

When I go to "My Groups" Menu under "My Commons" - it says "No Pending Invites".
However, when I click on "No Pending Invites" sure enough there is an invitation from the [x] Group.
I accepted the invitation and now have access to the Group.

Haven't verified.


#1 Updated by Dominic Giglio almost 9 years ago

  • Target version changed from 1.4.7 to 1.4.8

#2 Updated by Dominic Giglio almost 9 years ago

  • Target version changed from 1.4.8 to 1.4.9

#3 Updated by Dominic Giglio almost 9 years ago


I believe I've found a small bug in the BP core that's causing this issue.

Here's what this issue boils down to:

The "My Groups" item in the "My Commons" menu is created by the setup_admin_bar() function starting on line 487 of bp-groups-loader.php. It calls groups_get_invites_for_user() from line 557 of bp-groups-functions.php. That function returns the result of calling the static method BP_Groups_Member::get_invites() from line 1024 of bp-groups-classes.php. That return value is an associative array with two keys: 'groups' and 'total'. It's the latter that's being checked and used in setup_admin_bar(). But it's using '->' notation instead of '[]' like it's a stdObject. As soon as I changed it from $count->total to $count['total'] the menu correctly displayed the proper number of pending invites. (screenshot attached)

I say I "believe" that I've found a bug in core because this seems like an incredibly obvious bug and I can't believe it hasn't been caught yet. Let me know what you think and if I should open a Trac ticket for the community to investigate.

#4 Updated by Boone Gorges almost 9 years ago

  • Status changed from Assigned to Resolved

Good catch. Looks like this had already been fixed for trunk. I've backported the fix to the 1.6 branch.

Applied to CAC in

#5 Updated by Dominic Giglio almost 9 years ago

Awesome, but you missed one small spot in our repo.

Line 505 of bp-groups-loader.php:

if ( !empty( $count->total ) )

Has to be changed as well or that if() will never be true.

Also available in: Atom PDF