Opened 11 years ago
Closed 11 years ago
#5703 closed enhancement (fixed)
friends_check_friendship_status() doesn't check BP_User_Query
Reported by: | r-a-y | Owned by: | r-a-y |
---|---|---|---|
Milestone: | 2.1 | Priority: | normal |
Severity: | normal | Version: | 1.7 |
Component: | Friends | Keywords: | has-patch commit |
Cc: |
Description
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
- tobp_friends_filter_user_query_populate_extras()
. This property references the various friendship statuses fromBP_Friends_Friendship::check_is_friend()
. friends_check_friendship_status()
now checks for this property during the member loop and avoids any additional DB lookups.
Attachments (2)
Change History (4)
Note: See
TracTickets for help on using
tickets.
Heroic!
5703.02.patch adds unit tests.