Opened 13 years ago
Closed 13 years ago
#4061 closed defect (bug) (fixed)
Member count in Members Directory 'All Members' tab is incorrect
Reported by: | boonebgorges | Owned by: | boonebgorges |
---|---|---|---|
Milestone: | 1.6 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Members | Keywords: | |
Cc: | jay.collier@…, georgemamadashvili@… |
Description
The member count in the 'All Members' tab does not match the count in the pagination numbers below. The reason is this: the tab count traces back to the function bp_core_get_total_member_count(), which does a true count of rows in wp_users. However, our BP members queries join against wp_usermeta for the last_activity meta item, and thus do not return members who do not have a last_activity meta set. Something should be done to make these numbers match.
One possibility is to change BP so that we don't require last activity. This is not viable: among other things, this would break multi-network installations of BP, which keep their member directories separate by exploiting prefixed last_activity usermeta.
I don't think we should go changing what bp_core_get_total_member_count() queries, because there are probably plugins (and maybe even places in BP) where it's being exploited for its current behavior.
So I think the best bet is to introduce a separate set of functions for getting the number of BP-recognized users, which will return the same value as the members queries. I'll write the patch, but first I wanted to make sure there were no objections.
Change History (5)
#2
@
13 years ago
- Keywords 2nd-opinion removed
- Milestone changed from Awaiting Review to 1.6
Sounds fine
#5
@
13 years ago
- Resolution set to fixed
- Status changed from new to closed
(In [5987]) 'Total member count' cleanup:
- Introduces bp_core_get_active_member_count() to get an accurate count of members with recorded last_activity
- Points bp_get_total_member_count() to bp_core_get_active_member_count(), so that 'All Members' tab count on member directories matches the total count prepared by BP_Core_User::get_users(). Fixes #4061
- Changes 'All Members' count in activity/index.php to use bp_get_total_member_count(), for greater accuracy and consistency between activity and members components
- Introduces a cache-busting function to be fired when member counts change (new members, spam status changed, member deleted)
Quick follow-up: when I say "introduce a separate set of functions", I really mean "introduce a single new function", and then point the existing template function bp_get_total_member_count() to it. Otherwise child themes that override this file won't get the fix.