Skip to:
Content

BuddyPress.org

Opened 13 years ago

Closed 13 years ago

#3804 closed defect (bug) (fixed)

bp_core_fetch_avatar() doesn't respect 'alt'; we should be passing 'alt' and 'title' where possible

Reported by: boonebgorges's profile boonebgorges Owned by: boonebgorges's profile boonebgorges
Milestone: 1.6 Priority: normal
Severity: normal Version:
Component: Core Keywords:
Cc:

Description

Our directory templates are horrendously inefficient when it comes to displaying avatars. We don't pass 'alt' or 'title' to bp_core_fetch_avatar() (at least in the groups loop), which means that bp_core_fetch_avatar() has to pull up the group object, which means 10 extra queries a page. We already have the necessary information in the groups_template, which should be passed along.

Second, there is a problem in the bp_core_fetch_avatar() logic, so that 'alt' params won't be respected anyway. I'll fix both of these at the same time.

Change History (5)

#1 @boonebgorges
13 years ago

(In [5455]) Pass alt and title parameters to bp_core_fetch_avatar() on group directory page, when possible. Fixes alt logic and reduces queries in bp_core_fetch_avatar(). See #3804

#2 @boonebgorges
13 years ago

r5455 cuts a couple dozen queries off of the group directory page. I need to go back and check this on (at least) the member directory, and make sure that my changes to bp_core_fetch_avatar()'s alt param will be fully backward compatible.

#3 @r-a-y
13 years ago

Yes! Thank you!

The main 'bp_core_fetch_avatar' filter also needs to pass the alt text as an additional parameter as well.

I had to code a workaround for this by hooking into the "bp_core_avatar_alt" filter.

#4 @boonebgorges
13 years ago

See also #3806, where I propose dropping the root of the problem, which is that bp_core_fetch_avatar() encourages people to pass sprintf-able strings as 'alt' values.

#5 @boonebgorges
13 years ago

  • Resolution set to fixed
  • Status changed from new to closed

This is completed in #3806 as well as r5455. Whee!

Note: See TracTickets for help on using tickets.