[buddypress-trac] [BuddyPress Trac] #7614: Group member count routine is bad
buddypress-trac
noreply at wordpress.org
Thu Nov 3 14:20:18 UTC 2022
#7614: Group member count routine is bad
--------------------------+-----------------------
Reporter: boonebgorges | Owner: imath
Type: enhancement | Status: assigned
Priority: normal | Milestone: 11.0.0
Component: Groups | Version: 1.2.3
Severity: normal | Resolution:
Keywords: needs-patch |
--------------------------+-----------------------
Comment (by dcavins):
Replying to [comment:22 sjregan]:
> So while it may seem odd that people would want to add inactive users to
a group, it is useful reason for some.
Thanks for your feedback! I always assume that a behavior that seems odd
to me has a use case somewhere in the BP universe. :)
If we are ok with adding not-yet-active users to groups and showing them
in the members list, maybe the simplest (and most logical) answer is to
just include those users in the count? The exclusion happens in
`BP_Group_Member_Query`:
https://github.com/buddypress/buddypress/blob/master/src/bp-groups/classes
/class-bp-group-member-query.php#L544-L564
If the `count` parameter is removed from
`BP_Groups_Group::get_total_member_count()` then this validation step is
skipped and the count returns all group members.
https://github.com/buddypress/buddypress/blob/master/src/bp-groups/classes
/class-bp-groups-group.php#L1781-L1817
And, with that change, I can verify that when a non-active user is added,
the count is incremented. (And if that user is deleted before logging in,
the group count is decremented.)
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/7614#comment:23>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac
More information about the buddypress-trac
mailing list