Avatar display error bug


This seems to be a bug
Avatar quote post fail

(Mittineague) #6

I have noticed this recently on my localhost install, but I figured it was a VM on Windows thing and didn’t look into it.

<aside class="quote" data-post="9" data-topic="81"><div class="title" style="cursor: pointer;">
<div class="quote-controls"><i class="fa fa-chevron-down" title="expand/collapse"></i>
<a href="/t/table-plugin-test/81/9" title="go to the quoted post" class="back"></a>
<img width="20" height="20" src="//localhost:4000/letter_avatar/goodguy1/40/3.png" class="avatar">goodguy1:</div>
<blockquote><p>Let me try this</p></blockquote></aside> 

Hmmm, the double slash doesn’t look right

(cpradio) #7

No, double slash is very much intentional, it permits it to be protocol agnostic. So it works on HTTP or HTTPS


Load picture wrong?

(Marcin Rataj) #9

I noticed something related:
I have an external JS app that fetches /latest.json from my Discourse and displays a list of topics with avatars.

Recently, Discourse added image_magick_version hash to the URL for default Letter Avatars:


This broke letter avatars in my 3rd party app because /latest.json still returns letter_avatar URL without hash:


And this causes an empty dot to be returned instead of actual avatar:

I don’t understand the logic fully to provide a PR with a fix,
but perhaps someone else could take a look?

(TechnoBear) #10

It seems to be happening here with linked topics:

Screenshot where I first noticed it:

Link to that topic:

Linking to a post, rather than the topic, doesn’t seem to produce the error.

(Jeff Atwood) #11

OK so the bug might be oneboxing a topic. If you can repro via the above steps (thanks @technobear), can you have a peek @eviltrout?


Post new topics will be 404 error


(Sam Saffron) #13

I was pretty sure @awesomerobot cleaned a lot of these up, maybe select2.png is still hanging out somewhere.

(Sam Saffron) #14

I think we need a global rebake, I may queue one. At least a rebake of all posts with images.

(Jeff Atwood) #15

Yes please we need to rebake all posts.

(TechnoBear) #16

The issue also seems to occur linking to a post on another site (e.g. linking to meta from SitePoint, or vice versa).

Exhibit A:

(Jeff Atwood) #17

Yep hopefully @eviltrout can fix this next week.

(Robin Ward) #18

I’ve pushed a fix for this. I need @zogstrip to review but it is working locally:


(Sam Saffron) #19

Sorry had to revert that.

The version for letter avatars was changed to a hash of the image magic version + fonts installed as a prefix.

This ensures that if we upgrade image magick at any time in the future we invalidate all old avatars. We can not use a simple number there. If anything anywhere is generating letter avatars incorrectly we need to fix that.

Discourse update has broken avatar URLs for WordPress integration
(Robin Ward) #20

But reverted it’s more broken than my fix was. I agree with adding the hash in, but right now there are missing avatars everywhere.

(Sam Saffron) #21

fixed per:


(Marcin Rataj) #22

Will it fix "avatar_template":"/letter_avatar/(..) URLs in https://meta.discourse.org/latest.json?
(I guess meta is still runing a version without the fix?)

(Adam Capriola) #23

Did the templates get changed again with the release of 1.3.0.beta7? Within the past day we’ve started seeing blanks from letter avatar templates that were saved externally to a SSO site I’m working on.

(Sam Saffron) #24

I had to change the template to codify the image magic version into it.