Project

General

Profile

Actions

Bug #20847

closed

Group member count not updating

Added by Matt Gold 3 months ago. Updated 2 months ago.

Status:
Resolved
Priority name:
Normal
Assignee:
Category name:
Groups (misc)
Target version:
Start date:
2024-08-29
Due date:
% Done:

0%

Estimated time:
Deployment actions:

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

Actions #1

Updated by Boone Gorges 3 months ago

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.

Actions #2

Updated by Raymond Hoh 3 months 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.

Actions #3

Updated by Boone Gorges 3 months 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?

Actions #4

Updated by Matt Gold 3 months 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

Actions #5

Updated by Raymond Hoh 3 months 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.

Actions #6

Updated by Matt Gold 3 months ago

Thanks, Ray!

Actions #7

Updated by Boone Gorges 2 months ago

  • Status changed from Staged for Production Release to Resolved
Actions

Also available in: Atom PDF