Wrong Avatar and Gravatar after BP update
-
Is this the same problem as this: https://buddypress.org/forums/topic/only-admin-avatar-in-blog-1
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.
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?
What theme are you using?
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?
Here’s another example of the problem:
http://jibenow.com/david/2010/02/22/want-to-win-debates-dont-use-evidence/
*bump*
I am experiencing the same problem. Main blog (BP default theme) is fine, member blogs show author avatar in all comments.
Ah, finally someone with the same problem. Could we get some help with this. Please? Someone?
Here’s something else I dug up while searching for a solution: https://buddypress.org/forums/topic/social-018-by-utkarsh-kukreti
Thanks for the reference to the other thread. I saw that it’s a bug. Good to know, thanks!
You can see my fix here.
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)
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.
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.
@lgedeon, thank you.
@lgedeon – Thank you! That was making me nuts!
Just upgraded to 1.2.4 and this happened again. So … No. Trac time!
Tried
if ( is_string( $user ) ) return $avatar;
Still no luck! Any solutions?
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.
- The topic ‘Wrong Avatar and Gravatar after BP update’ is closed to new replies.
paulhastings0
@paulhastings0
14 years, 8 months ago
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