Skip to:
Content

BuddyPress.org

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#6737 closed defect (bug) (fixed)

Avatar src attribute must not contain the "d" param if the Gravatar logo is chosen under Settings > Discussion > Default Avatar

Reported by: henry.wright Owned by: r-a-y
Milestone: 2.4.2 Priority: normal
Severity: normal Version: 2.4.0
Component: Media Keywords: good-first-bug has-patch
Cc:

Description

The Image Requests Gravatar article explains that the following image is shown when an email address has no matching Gravatar image:

http://www.gravatar.com/avatar/00000000000000000000000000000000

The article goes on to say:

If you'd prefer to use your own default image (perhaps your logo, a funny face, whatever), then you can easily do so by supplying the URL to an image in the d= or default= parameter.

If this particular image is chosen in Settings > Discussion > Default Avatar, the src attribute in the image HTML must not contain the d parameter, else the image won't display.

Steps to reproduce:

  1. Select the Gravatar logo under Settings > Discussion > Default Avatar
  2. View a BuddyPress member who a) doesn't have an uploaded profile photo and b) doesn't have a Gravatar

Attachments (2)

6737.diff (584 bytes) - added by henry.wright 4 years ago.
6737.02.patch (663 bytes) - added by r-a-y 4 years ago.

Download all attachments as: .zip

Change History (12)

#1 @boonebgorges
4 years ago

  • Keywords needs-patch good-first-bug added
  • Milestone changed from Awaiting Review to 2.5

Wow, weird that we never noticed this before. Is it a recent change in the Gravatar API, or a regression on our part?

#2 @henry.wright
4 years ago

Not sure if the Gravatar API has a public changelog to find out? My guess is the Grav logo isn't a popular choice and in cases where it was chosen, a profile photo upload most probably took precedence so the problem wasn't noticed.

#3 @r-a-y
4 years ago

  • Milestone changed from 2.5 to 2.4.1
  • Owner set to r-a-y
  • Status changed from new to assigned

Thanks for the catch, @henry.wright.

This is my fault.

In #6622, when I added in the extra parameters from the 'get_avatar' filter from WordPress 4.2.0, I tacked on the 'd' parameter to Gravatar requests.

Looking into it.

@henry.wright
4 years ago

#4 @henry.wright
4 years ago

  • Keywords has-patch added; needs-patch removed

Hi r-a-y,

I was thinking the fix could be to supply the d param conditionally, only when the default Grav isn't gravatar_default (see attached patch).

@r-a-y
4 years ago

#5 @r-a-y
4 years ago

Thanks for the patch, @henry.wright.

02.patch is a slight tweak, but is basically the same thing.

Will commit later today. Thanks again!

#6 @r-a-y
4 years ago

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

In 10368:

Avatars: Fix issue when selecting 'Gravatar Logo' from 'Settings > Discussion > Default Avatar'.

If 'Gravatar Logo' was selected from the 'Settings > Discussion' admin
page, avatars on BuddyPress pages that did not have a valid Gravatar would
not display properly.

This is a regression due to changes in #6622.

Fixes #6737 (trunk).

Props henry.wright.

#7 @r-a-y
4 years ago

In 10369:

Avatars: Fix issue when selecting 'Gravatar Logo' from 'Settings > Discussion > Default Avatar'.

If 'Gravatar Logo' was selected from the 'Settings > Discussion' admin
page, avatars on BuddyPress pages that did not have a valid Gravatar would
not display properly.

This is a regression due to changes in #6622.

Fixes #6737 (2.4-branch).

Props henry.wright.

#8 @r-a-y
4 years ago

In 10370:

Tests: Fix avatar test due to changes in #6737.

See #6737.

#9 @djpaul
4 years ago

In 10389:

Tests: Fix avatar test due to changes in #6737. (2.4 branch)

See #6737.

#10 @DJPaul
4 years ago

  • Component changed from API - Avatars to Media
Note: See TracTickets for help on using tickets.