Opened 12 years ago
Closed 12 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 |
|---|---|---|---|
| Priority: | normal | Milestone: | 2.1 |
| Component: | Friends | Version: | 1.7 |
| Severity: | normal | 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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Heroic!
5703.02.patch adds unit tests.