Erratic behaviour when clicking an attachment link

AI-generated summary

User georgiano reported erratic behavior when clicking attachment links on a Discourse forum requiring login. In Firefox, the first click on an attachment while logged out triggered a login popup, but subsequent clicks on the same link did nothing, while clicking a different attachment resulted in an empty page. Internet Explorer users consistently encountered 404 errors for any attachment click. codinghorror identified this as a probable bug and requested zogstrip investigate. zogstrip initially applied a fix via commit ad3d226, but codinghorror noted the original poster (OP) confirmed the issue persisted. zogstrip then deployed a second fix via commit 5783e90. Finally, georgiano verified that the attachment links were functioning correctly after the second patch.

These bugs are probably related.
My config requires users to be logged on to download attachments.

I have several attachments in one post.

Firefox

  1. When logged off user first time clicks attachment, popup window appears saying login is required. Any consecutive clicks on the same attachment does nothing.
  2. Clicking another attachment renders empty page.

If there is only one attachment in post then see fact 1
After reloading page same behaviour happens.

Internet explorer
Clicking any attachment always shows 404 error page.

access.log
GET requests on attachments return 404.

Probably a bug. @zogstrip can you take a look after polls deployed tomorrow?

1 Like

This should be fixed now :tiger:

https://github.com/discourse/discourse/commit/ad3d2269b2b76c45fcdcfba9a5a6379c2cf140ee

1 Like

OP says the bug is not fixed @zogstrip.

1 Like

It should now be fixed :penguin:

https://github.com/discourse/discourse/commit/5783e908ea5741515c62f7aa51055e04f8faa635

2 Likes

I’ve checked and it works now. :thumbsup:
Thank you.

1 Like