[buddypress-trac] [BuddyPress Trac] #7614: Group member count routine is bad

buddypress-trac noreply at wordpress.org
Wed Aug 18 13:58:52 UTC 2021


#7614: Group member count routine is bad
-------------------------------------------------+-------------------------
 Reporter:  boonebgorges                         |       Owner:
                                                 |  espellcaste
     Type:  enhancement                          |      Status:  assigned
 Priority:  normal                               |   Milestone:  10.0.0
Component:  Groups                               |     Version:  1.2.3
 Severity:  normal                               |  Resolution:
 Keywords:  good-first-bug has-patch has-unit-   |
  tests                                          |
-------------------------------------------------+-------------------------
Changes (by espellcaste):

 * keywords:  needs-patch needs-unit-tests good-first-bug => good-first-bug
     has-patch has-unit-tests
 * version:   => 1.2.3


Comment:

 Here is a patch which does a few things:

 - Updates `groups_get_total_member_count` to grab from group cache if
 available
 - Fallbacks to `BP_Groups_Group::get_total_member_count`
 - `BP_Groups_Group::get_total_member_count` was updated to use
 `groups_get_group_members` so that only active users are considered
 (banned users are excluded)
 - The "Refresh the group member count meta." on the group member template
 was removed. This is not necessary since there is already code to update
 this cache when a user leaves/join/remove from a group or when a user is
 deleted.
 - Ticket version was updated to 1.2.3, this is when the
 `groups_get_total_member_count` function was introduced.
 - Also, minor tweaks were added.

-- 
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/7614#comment:2>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list