Groups > Invitations reads "No Pending Invites" even when there are
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.
#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'] 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. https://buddypress.trac.wordpress.org/ticket/4417