#3758 closed defect (bug) (duplicate)
Many database queries repeated when using bp_core_fetch_avatar to get group avatars
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Core | Keywords: | |
Cc: |
Description
I discovered this issue when I tried to run this to get group avatar for each topic - bp_the_topic_object_avatar()
This function in turn calls bp_core_fetch_avatar to grab group avatars
This function alone resulted in 60 extra database queries just to fetch alt text for each group. In fact many exact same queries are being repeated.
In function bp_core_fetch_avatar this is the part that's creating redundant queries.
elseif ( 'group' == $object ) $item_name = bp_get_group_name( new BP_Groups_Group( $item_id ) );
Change History (3)
Note: See
TracTickets for help on using
tickets.
Thanks for the report. The root of the problem is that we don't have good (or any :) ) cache support for calling up groups in this fashion. I've opened a more general ticket for this issue #3770, and I'll close this one as a duplicate. Please follow along there. Thanks again for bringing this up.