[buddypress-trac] [BuddyPress] #5106: Better sorting for new bp_group_has_members() query

buddypress-trac noreply at wordpress.org
Tue Jul 23 17:31:40 UTC 2013


#5106: Better sorting for new bp_group_has_members() query
--------------------------------------------+---------------------------
 Reporter:  aaclayton                       |       Owner:  boonebgorges
     Type:  defect (bug)                    |      Status:  closed
 Priority:  normal                          |   Milestone:  1.8.1
Component:  Groups                          |     Version:  1.8
 Severity:  normal                          |  Resolution:  fixed
 Keywords:  has-patch needs-testing commit  |
--------------------------------------------+---------------------------

Comment (by boonebgorges):

 In [changeset:"7296"]:
 {{{
 #!CommitTicketReference repository="" revision="7296"
 Tell BP_Group_Member_Query queries to order by FIELD()

 BP_Group_Member_Query works by first querying for a list of group members
 that match the query params, sorted by date_modified. Then, it feeds those
 ids
 to the BP_User_Query parent class. In order to maintain the proper
 date_modified sort, we have to override BP_User_Query's ORDER BY param,
 and
 replace it with ORDER BY FIELD(), using the user ids from the first query.

 This fixes a regression in BP 1.8, where the default sort order for
 bp_group_has_members() was inadvertantly changed to user_id DESC, rather
 than
 the legacy date_modified that existed before the introduction of
 BP_Group_Member_Query.

 Fixes #5106
 }}}

--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/5106#comment:7>
BuddyPress <http://buddypress.org/>
BuddyPress


More information about the buddypress-trac mailing list