Bug #20847
closedGroup member count not updating
0%
Description
I had the first session of a class last night and accepted fifteen or so requests for my course group --
People were able to join the group, but the member count in the group interface shows zero members
https://commons.gc.cuny.edu/groups/introduction-to-digital-humanities-fall-2024/
Files
Updated by Boone Gorges about 1 month ago
- File Screenshot_2024-08-29_12-21-14.png Screenshot_2024-08-29_12-21-14.png added
- Description updated (diff)
- Status changed from Assigned to Reporter Feedback
- Deployment actions updated (diff)
When I look now (13:21 on Aug 29) I see a member count of 18. See screenshot.
Matt, are you still seeing the 0? If so, this is a user-specific problem. If not, it may be related to sticky cache or something like that.
Updated by Raymond Hoh about 1 month ago
Boone, I was just looking at this ticket before you and the cached value of the group member count was zero. I just force-updated the count by running groups_get_total_member_count( 3315, true );
and that updated the count correctly.
It looks like BuddyPress should bump the member count at https://github.com/buddypress/buddypress/blob/640ef8196f6291f6bc1f4c284b434650cd12dd53/src/bp-groups/bp-groups-functions.php#L3840-L3857 , but not sure why the count didn't update during a group member addition this time around.
Updated by Boone Gorges about 1 month ago
Boone, I was just looking at this ticket and the cached value of the group member count was zero. I just force-updated the count by running groups_get_total_member_count( 3315, true ); and that updated the count correctly.
Ah, we must have crossed paths.
Matt, can you say more about how users were added to the group? Did they request membership, which you then approved? Or did you send invites, which they then accepted? Or did you add them somehow as a super admin?
Updated by Matt Gold about 1 month ago
Thanks to you both. I confirm that I am now seeing 18 members in the count.
In terms of how users were added, they all visited the group homepage and requested membership, which I then approved (largely, think, in two batches through the "accept all" link). I was not using my super admin account at the time
Updated by Raymond Hoh about 1 month ago
- Status changed from Reporter Feedback to Staged for Production Release
- Target version set to 2.4.6
Thanks for the additional feedback, Matt.
I can confirm the bug due to object caching. In an attempt to optimize the group member query, I added a workaround to disable fetching unnecessary member info. I forgot to remove this workaround after the query, which led to the group member count not updating. I've just removed this tweak as I do not think it is necessary to begin with: https://github.com/cuny-academic-commons/cac/commit/ab3336da4a718ed282c61038c330e1c92cce5db0.
I haven't deployed this fix to production yet, so if you will be bulk-managing some group membership requests, let me know.
Updated by Boone Gorges about 1 month ago
- Status changed from Staged for Production Release to Resolved