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

buddypress-trac noreply at wordpress.org
Mon Jul 22 13:42:01 UTC 2013


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

 * keywords:   => has-patch needs-testing


Comment:

 There's a fundamental problem with the way `BP_User_Query`'s fallback sort
 order works, or at least the way `BP_Group_Member_Query` relies on it. In
 MySQL, when you fail to provide an `ORDER BY` clause, the primary column
 is assumed, which in this case is the user id.

 Because we want to maintain the sort order based on the order of the
 values passed to `IN`, we have to use a `ORDER BY FIELD()` clause. See
 5106.patch. This is not elegant, and probably won't perform well when a
 group has many thousands of members, but this is a larger architectural
 problem that doesn't really need to be addressed in this ticket.

 Posting here for review by another dev.

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


More information about the buddypress-trac mailing list