Skip to:
Content
Pages
Categories
Search
Top
Bottom

Wrong Avatar and Gravatar after BP update

  • @paulhastings0

    Participant

    Site: http://jibenow.com

    WPMU 2.9.1

    BP 1.2.1

    Whenever someone leaves a comment on a blog the avatar/gravatar that’s fetched every time is the blog author’s avatar. Even if the commenter isn’t even logged into the site and doesn’t even have a gravatar account the comment will still display the blog author’s comment.

    Here’s an example. As you can tell it looks kind of weird with 10 comments from different people but all with the same avatar.

    So I’ve been narrowing down the problem all night and here’s what I know:

    1. This problem occurred after upgrading to BP 1.2.1 . Whenever I disable all plugins on the site the problem persists. But then when I also disable Buddypress the problem stops and just shows gravatars. So I know it can’t be a WPMU problem.

    2. So I completely deleted BP 1.2.1 and manually reinstalled BP 1.2.1 but still no luck. Then I noticed that some themes that I had uploaded after upgrading to BP 1.2.1 displayed the gravatars and avatars correctly. Whether I choose the themes from the WordPress repository, download them somewhere else online, upload via the “New Themes” option, or via FTP they all display avatars and gravatars correctly.

    3. The only problem is with my pre-existing themes before the update. So I tried deleting a few and then uploading them again but with no luck.

    Any ideas?

    Thanks,

    Paul

Viewing 21 replies - 1 through 21 (of 21 total)
  • @mlovelock

    Participant

    @paulhastings0

    Participant

    It’s only remotely similar. Our main blog is fine… but that’s because it’s using a theme that was added after the BP 1.2.1 install (or rather, it was added <i>by</i> the BP 1.2.1 install – we’re using the default BP 1.2 theme).

    All new themes added after the install work correctly, it’s only the pre-existing themes which have problems… which means that everyone is still using the old themes and I can’t exactly tell them to switch themes right away.

    @paulhastings0

    Participant

    Alright, one other anomaly. When logged in as the administrator but I create a blog post on someone else’s blog that isn’t mine it shows the avatars/gravatars correctly, but only for that post. All the other blog posts on the blog by the blog owner show the avatars/gravatars incorrectly (i.e. they replace every gravatar/avatar with the blog owner’s uploaded avatar).

    Does anyone else have this problem? Or does anyone have a clue as to what’s wrong?

    @djpaul

    Keymaster

    What theme are you using?

    @paulhastings0

    Participant

    I’m using the default theme provided with BP 1.2.1 for the main site.

    At one point while I was still deciding which theme to use on the front I ran Andy’s BuddyPress Template Pack on another theme but then decided to just stay with the default theme in BP 1.2.1 . It was after that I noticed the gravatar/avatar problem. But maybe the problem existed before then?? I don’t know since I didn’t check.

    As I already mentioned I’ve already deleted BP 1.2.1 manually and then manually reinstalled it but still to no avail.

    Do you think it might be something with the default theme?

    @paulhastings0

    Participant

    @paulhastings0

    Participant

    *bump*

    @nightowl99

    Participant

    I am experiencing the same problem. Main blog (BP default theme) is fine, member blogs show author avatar in all comments.

    @paulhastings0

    Participant

    Ah, finally someone with the same problem. Could we get some help with this. Please? Someone?

    @paulhastings0

    Participant

    Here’s something else I dug up while searching for a solution: https://buddypress.org/forums/topic/social-018-by-utkarsh-kukreti

    @nightowl99

    Participant

    Thanks for the reference to the other thread. I saw that it’s a bug. Good to know, thanks!

    @paulhastings0

    Participant

    You can see my fix here.

    @developdaly

    Participant

    I’m having this issue as well. However, my problem does exist at the root blog. I’m using WP 2.9.2.

    Example: http://www.imahotmom.com/fitness-family-2010-week-9/ (hiding the images with CSS until fixed)

    @parkstreet

    Participant

    Has anyone else found a fix for this yet or a way to reset? This fix does not work for me: https://buddypress.org/forums/topic/wrong-avatar-and-gravatar-after-bp-update#post-40465 I am only having this issue with the theme that was activated during the upgrade. All other themes seem to work.

    @lgedeon

    Member

    I found a solution for my version of the problem and learned a few things along the way that might help with you BuddyPress avatar problems.

    Full text at: http://luke.gedeon.name/buddypress-wrong-avatar-fix.html

    What I found:

    In the file /wp-content/plugins/buddypress/bp-core/bp-core-avatars.php, lines 344 and following contain the following code:

    global $authordata;

    if ( is_object( $user ) )

    $id = $user->user_id;

    else if ( is_numeric( $user ) )

    $id = $user;

    else

    $id = $authordata->ID;

    if ( empty( $id ) )

    return $avatar;

    I think that last “if statement” may be there to catch cases where the commenter does not have a BuddyPress account (which is the majority on my site at this point). However, if you look closely at the block just above the “if ( empty( $id))” you will notice $id is never going to be empty at this point.

    That suggests two possible solutions.

    Solution 1:

    I have not tested this, but it makes sense that you could move the last “if statement” above the first “if statement.” That way you can check for “empty( $id )” before it gets set to”$authordata->ID”

    Solution 2:

    I found it works quite well to add these lines just under the last “if statement.”

    if ( is_string( $user ) )

    return $avatar;

    This will catch any case where an email is sent as input, which is what all (most) non-buddypress themes send. Cases where numbers or objects are sent (the BuddyPress method) will be handled normally.

    Maybe I can get this added into the next release of BuddyPress.

    @parkstreet

    Participant

    @lgedeon, thank you.

    @ipstenu

    Participant

    @lgedeon – Thank you! That was making me nuts! :)

    @ipstenu

    Participant

    Just upgraded to 1.2.4 and this happened again. So … No. Trac time!

    @ipstenu

    Participant

    @gotamil

    Member

    Tried

    if ( is_string( $user ) )
    return $avatar;

    Still no luck! Any solutions?

    @pauld123

    Participant

    I have had the same problems and the proposed solutions here do not work for me either.

    For now I have just used the older version of bp-core-avatars.php from https://trac.buddypress.org/browser/branches/1.2/bp-core/bp-core-avatars.php?rev=2876#L109 which has worked although there may be knock on affects from using the old file that I am unaware of.

    There is also a thread here about it https://buddypress.org/community/groups/how-to-and-troubleshooting/forum/topic/how-to-show-avatars-uploaded-via-buddypress-in-wordpress-mu/

    Paul.

Viewing 21 replies - 1 through 21 (of 21 total)
  • The topic ‘Wrong Avatar and Gravatar after BP update’ is closed to new replies.
Skip to toolbar