Skip to:
Content

BuddyPress.org

Opened 11 years ago

Closed 11 years ago

#5292 closed defect (bug) (no action required)

Error with default 'mysteryman' avatar

Reported by: bradt1999's profile bradt1999 Owned by:
Milestone: Priority: normal
Severity: normal Version: 1.8.1
Component: Members Keywords:
Cc:

Description

In BuddyPress, when the user has not uploaded an avatar, and has not got an associated gravatar, the source should load the mysteryman image. However, the url http://gravatar.com/avatar/10fb5ee9bdada07f189e73040d9337fe?d=http://localhost/skyline123/wordpress/wp-content/plugins/buddypress/bp-core/images/mystery-man.jpg&s=50&r=G is inserted. Obviously, the mysteryman image is being wrongly concatenated onto the gravatar url. As a result the image is not found.

I have identified the fault is in bp-members-template.php, in the function bp_get_signup_avatar (line 1140)

As a result images are not found on all members pages, resulting in an unprofessional looking website

Change History (1)

#1 @boonebgorges
11 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

Obviously, the mysteryman image is being wrongly concatenated onto the gravatar url.

I'm not sure what you mean by "being wrongly concatenated". Do you mean that *it shouldn't be concatenated at all*, or that *the concatenation is incorrect*?

The concatenation is intentional. Your BuddyPress installation has no way of knowing whether a user has a Gravatar or not. We simply pass a hashed version of the user's email address along to gravatar.com, and let Gravatar decide what to do. If that email address is associated with a Gravatar, that Gravatar is served up. If not, then Gravatar will fall back on the value of 'd' (the mysteryman).

The reason why the images are not found on your installation is because you are testing on localhost. Last year, Gravatar made some security-related changes that made it impossible to use a non-public image file as the value of 'd'. gravatar.com does not have access to your localhost, thus it can't act as a proxy for your image. See #4571 for an extended discussion of the problem, and some suggestions for working around it in BuddyPress.

As long as your production site is public, this problem will go away when you deploy. If you would like to avoid using Gravatar altogether, do this:

add_filter( 'bp_core_fetch_avatar_no_grav', '__return_true' );

Closing this ticket as invalid, because I believe that the feature is working as expected, and future discussion can take place on #4571. If I'm misunderstanding, please feel free to reopen with details.

Note: See TracTickets for help on using tickets.