Skip to:
Content

BuddyPress.org

Opened 15 years ago

Closed 14 years ago

#2288 closed defect (bug) (fixed)

bp_core_fetch_avatar_filter() doesn't support email address in $user parameter [HAS-PATCH]

Reported by: rvenable's profile rvenable Owned by: apeatling's profile apeatling
Milestone: 1.5 Priority: normal
Severity: Version:
Component: Core Keywords: has-patch
Cc:

Description

bp_core_fetch_avatar_filter() is used as a filter on the WP get_avatar() function. The 'get_avatar' filter passes a variable $id_or_email (see pluggable.php, line 1631) which becomes the $user parameter of bp_core_fetch_avatar_filter(). However, $id_or_email can either be a user ID, a user object, or a user email address, but bp_core_fetch_avatar_filter() does not support the email address.

This breaks some themes that pass a user email address to get_avatar() for comments, causing the comments to display the avatar for the blog post author rather than the comment author.

This cannot be demonstrated on testbp.org because it is no longer running WPMU.

Attachments (2)

avatar_fix.diff (613 bytes) - added by rvenable 15 years ago.
user_by_email.patch (422 bytes) - added by johnjamesjacoby 14 years ago.
The only reason not to do this, is for the potential DB hits in the event the user_id isn't cached. I imagine that's why this was left out. Assigned to Andy for review.

Download all attachments as: .zip

Change History (6)

@rvenable
15 years ago

#1 @DJPaul
15 years ago

  • Priority changed from minor to normal

@johnjamesjacoby
14 years ago

The only reason not to do this, is for the potential DB hits in the event the user_id isn't cached. I imagine that's why this was left out. Assigned to Andy for review.

#2 @johnjamesjacoby
14 years ago

  • Owner set to apeatling
  • Status changed from new to assigned

#3 @johnjamesjacoby
14 years ago

  • Milestone changed from 1.2.4 to 1.3

Bumping to 1.3 for future review.

#4 @johnjamesjacoby
14 years ago

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

(In [3035]) Fixes #2288, #2183, and #2426.

Note: See TracTickets for help on using tickets.