This seems to be a bug
Avatar quote post fail
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> </div> <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
No, double slash is very much intentional, it permits it to be protocol agnostic. So it works on HTTP or HTTPS
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?
It seems to be happening here with linked topics:
Screenshot where I first noticed it:
Linking to a post, rather than the topic, doesn’t seem to produce the error.
Post new topics will be 404 error
I was pretty sure @awesomerobot cleaned a lot of these up, maybe select2.png is still hanging out somewhere.
I think we need a global rebake, I may queue one. At least a rebake of all posts with images.
Yes please we need to rebake all posts.
The issue also seems to occur linking to a post on another site (e.g. linking to meta from SitePoint, or vice versa).
I’ve pushed a fix for this. I need @zogstrip to review but it is working locally:
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
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.
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?)
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.
I had to change the template to codify the image magic version into it.