All my users get a default identicon when they register.
When a user uploads a custom avatar then deletes it, the identicon is lost, he has no more avatar on his profile page.
I don’t find anything on the DB to restore his automatically generated Gravatar Identicon.
How can I put it back please ?
Please check this thread: https://buddypress.org/support/topic/changing-the-default-mystery-man-avatar/
Thanks for your help. I red that link but it seems my problem is different.
Actually what I want is my user’s gravatar identicon to be restored after the user deletes his custom avatar.
When my users register, they automatically get an identicon from gravatar (each one is different). When they change this to a custom avatar, and then delete it, their gravatar is not getting back.
Instead they get no avatar and their cover-image falls above their profile’s navigation links.
I’m using Heritage default BP theme.
I have tried to generate the same scenario with the default theme(2016) and Legacy Template. Please see: https://screencast-o-matic.com/watch/cF6eryYlWO
It works fine for me. Can you please check the same with default theme as well as try disabling other plugins except BuddyPress to check if any of them created the issue.
At first, I thought your test was different because the default avatar in you example is a static one called “Logo (Gravatar)”, the same for every users, while mine is a dynamic one called “Identicon (generated)”, a different one for every users.
I tried your example on a test server, that worked. Then I tried with my case (generated identicon), that worked too !
Finally I found the reason, in fact the replacement avatar was not coming from the classic “upload a picture”, it was coming from a social plugin (nextend) which retrieves the facebook avatar when you link your WP-account with FB-account, and stores it in the server but in a different folder that buddypress does. (Plus some extra “butterflies” in the DB …)
I reproduced it several times today to understand exactly what is happening, I write it down in case that could help anyone in the future.
What I did first was unlinking the FB-account, but I realized the avatar was still there.
So I clicked on “delete the picture” from my BP-profile page. Success message, but the FB-avatar is still there.
Then I use “inspect element” on my browser. I found his name is “user-99-2-150×150.jpg” and I get the path to the folder too.
First I search that file in the database, I found one “_wp_attachment_metadata” in “postmeta” table. I delete the row.
Here is the point I was stuck on. The picture is gone but there is no more avatar and the header is now above the profile tabs 🙁
Then I went to the server folders, removed the file but what I missed last time is that there are two files 🙄 … “user-99-2-150×150.jpg” & “user-99-2.jpg” … I deleted both, no changes, and I did it so fast, I forgot there was 2.
I really thought the problem was coming from BP/Gravatar.com, I thought the path to my original avatar was lost in the DB (and using a dynamic name).
Finally, thanks to your answer, I just inspected the header again, and found the new avatar link pointing to the second file “user-99-2.jpg” !! Yes !! 🙄
Back to the database to look for this second file and there are two answers :
One “_wp_attachment_metadata” row in “postmeta” table -> deleted. (at this stage the original gravatar is back)
One “attachment” row in “posts” table -> deleted. (no need to keep this row)
The problem is solved. Thanks a lot for your answer, you drove me to the good direction.
Have a nice day 🙂
- You must be logged in to reply to this topic.