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?
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?
Thanks for the reference to the other thread. I saw that it’s a bug. Good to know, thanks!
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: http://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! 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 http://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 http://buddypress.org/community/groups/how-to-and-troubleshooting/forum/topic/how-to-show-avatars-uploaded-via-buddypress-in-wordpress-mu/
Paul.