[buddypress-trac] [BuddyPress Trac] #5703: friends_check_friendship_status() doesn't check BP_User_Query

buddypress-trac noreply at wordpress.org
Tue Jun 10 20:01:15 UTC 2014


#5703: friends_check_friendship_status() doesn't check BP_User_Query
-------------------------+-----------------------
 Reporter:  r-a-y        |      Owner:
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  2.1
Component:  Friends      |    Version:  1.7
 Severity:  normal       |   Keywords:  has-patch
-------------------------+-----------------------
 If you're on the members directory and you're logged in, during the
 members loop, a check is done to see if you are friends with each person
 in the member loop.

 However, when we do this friendship check with
 `friends_check_friendship_status()`, we are not referencing the already-
 queried data from `bp_friends_filter_user_query_populate_extras()`.

 As a result, twenty additional DB queries are added on the members
 directory.

 Attached patch removes these queries by:
 * Adding an additional property - `friendship_status` - to
 `bp_friends_filter_user_query_populate_extras()`.  This property
 references the various friendship statuses from
 `BP_Friends_Friendship::check_is_friend()`.
 * `friends_check_friendship_status()` now checks for this property during
 the member loop and avoids any additional DB lookups.

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


More information about the buddypress-trac mailing list