News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Custom avatars missing after forum upgrade

Started by user58389239, May 29, 2023, 01:17:36 PM

Previous topic - Next topic

user58389239

Hi,
Working on an upgrade from 2.0.19 to 2.1.3. I noticed that custom avatars are missing, but users who selected from "default" avatars, those are working.

I did check and the custom_avatar folder was created in the upgrade process, it does have 63 .png files. Also the attachment folder exists with a couple thousand .dat files.

I also verified and the Avatar folder in the Admin seems correct.

Not sure if it matters but on production "live" site, the custom avatars were formatted like so:
https://www.site.com/index.php?action=dlattach;attach=2455;type=avatar

Sir Osis of Liver

Run repair_settings, see if custom avatar url and directory are correct.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

JayH1119

I had to move and rename my custom avatars when upping from 2.0.19 to 2.1.3.

Sir Osis of Liver

Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

JayH1119

With a select against the db that created the necessary shell commands.

user58389239

I checked repair_settings.php and custom avatar url and directory are both correct

Jay, would you be able to explain more detail? I know how to do a select against the DB, but do you have details on the shell commands you ran? Can you explain what folder you moved the avatars from and to? Step-by-step instructions would be super helpful if you don't mind!

user58389239

Okay so I took another look, and it looks like the custom avatars ARE in the custom_avatar folder as .png files as they should be. But they are not showing on the site.

I double-checked and the custom avatar directory is correct in repair_settings.php and I re-saved it just to make sure.

So avatars ARE in the folder, but they are not displaying. You just get the blank.png icon.

Sir Osis of Liver

Upgrader renames avatars from file_hash to filename and moves them to /custom_avatar.  Is that what you did?
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

user58389239

Upgrader did what it's supposed to...the avatars have filenames and they are in the /custom_avatar folder. But the users who are supposed to have custom avatars (myself included) do not have them.

JayH1119

Quote from: user58389239 on May 30, 2023, 05:00:13 PMOkay so I took another look, and it looks like the custom avatars ARE in the custom_avatar folder as .png files as they should be. But they are not showing on the site.

I double-checked and the custom avatar directory is correct in repair_settings.php and I re-saved it just to make sure.

So avatars ARE in the folder, but they are not displaying. You just get the blank.png icon.

If your file names in the custom_avatar directory follow this general pattern: avatar_uuuuu_tttttttttt.png, where uuuuu is the id_member of the user and tttttttttt is the unix_timestamp of the date added, then it's not the same issue I had.

Sir Osis of Liver

Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

user58389239

Huh, now that's strange. Yes, I can link directly to the avatar, but it shows a broken image. It resolves in the browser (doesn't show a 404) but the images don't work. All the files do have a filesize, they're not empty. Permissions 755.

I also downloaded one via FTP and my computer won't open it. It's like the .png files got corrupted.

Sample attached

Sir Osis of Liver

Not on my computer, but if you post a link to an avatar will have a look tomorrow.

Are you sure the file is png?
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

user58389239

I was able to solve this by re-running the upgrade. Marking as solved.

Advertisement: