[buddypress-trac] [BuddyPress Trac] #5584: Pagination is removed when all groups are empty

buddypress-trac noreply at wordpress.org
Thu Apr 24 20:28:23 UTC 2014


#5584: Pagination is removed when all groups are empty
--------------------------+-----------------------------
 Reporter:  dansearle     |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Groups        |    Version:  2.0
 Severity:  normal        |   Keywords:
--------------------------+-----------------------------
 If all the groups are empty (they have no members) then the pagination in
 the WP Admin groups list isn't shown. See /wp-admin/admin.php?page=bp-
 groups

 The way the method BP_Groups_Group->get works means the two queries return
 inconsistent results, e.g. the query to fetch the list of groups doesn't
 always join to the members table; however the query to count them does.

 Compare
                 $sql['select'] = "SELECT DISTINCT g.id, g.*,
 gm1.meta_value AS total_member_count, gm2.meta_value AS last_activity";
                 $sql['from']   = " FROM
 {$bp->groups->table_name_groupmeta} gm1,
 {$bp->groups->table_name_groupmeta} gm2,";

                 if ( ! empty( $r['user_id'] ) ) {
                         $sql['members_from'] = "
 {$bp->groups->table_name_members} m,";
                 }


 with

                 $total_sql['select'] = "SELECT COUNT(DISTINCT g.id) FROM
 {$bp->groups->table_name} g, {$bp->groups->table_name_members} gm1,
 {$bp->groups->table_name_groupmeta} gm2";

                 if ( ! empty( $r['user_id'] ) ) {
                         $total_sql['select'] .= ",
 {$bp->groups->table_name_members} m";
                 }

--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/5584>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list