REMINDER - Stay logged in for at least 2 hours a week to get whitelisted.
Also it helps build a picture where our "good traffic" is coming from for detection scripts.
:o)

Posting error with attachments bug, and what I have done about it

Latest Atari related news.
User avatar
exxos
Site Admin
Site Admin
Posts: 28553
Joined: 16 Aug 2017 23:19
Location: UK

Posting error with attachments bug, and what I have done about it

Post by exxos »

A few of you may have hit an error when posting something with a file attached to it. You get a red "General Error" page saying "You are not allowed to access this file", and when you go back your post has been chopped up and needs re-typing. It is not you doing anything wrong, and it is nothing broken on the server. I checked all of that first.

Here is what actually happens. When you attach a file it sits in a holding area until you hit Post, and hitting Post is what claims it and sticks it to your message. The problem is that if the same form gets sent twice, the second attempt is still pointing at a file that has already been claimed. Instead of just telling you that, phpBB throws the whole page away, and your typing goes with it.

There are two ways to end up sending it twice. The obvious one is double clicking Post, or clicking it again because nothing seems to be happening. The other one is going back in your browser afterwards, because the browser hands you back the old posting page exactly as it was, files and all, even though those files have already been used up.

Most of you have probably seen the harmless version of this already without realising what it was. If there is no file attached there is nothing to fail on, so the same double send just posts your message twice and you end up deleting one of them. Exact same cause. It is only when a file is involved that it turns into an error page and eats your post.

This is a bug in the forum software itself, not something I have caused, and it is still there in the current version. There is an unofficial fix floating about for it, but it has never been properly tested by the phpBB team and it involves editing the forum's core files, which would get wiped out the next time I update the board. Not worth the risk.

So I have written my own add-on instead, which sits on top and cannot be wiped by an update. It does two things.

First, if the form gets sent twice within a few seconds, the second one is ignored. You will see the Post button briefly change to "Submitting..." and grey out. That is all it is doing, and it clears itself after a few seconds so you are never locked out. This is also what stops the accidental double posts.

Second, if you go back to a posting page that you have already sent, you will now get a warning above the message box telling you it has already been posted. If you really do want to send it again, press Post twice. The first press is refused, the second one goes through. Again, nothing is locked, it is just there to stop the accidental resend.

Two things worth knowing if you do land on that warning. Clicking Preview first does not get round it, as the same check runs on Preview as well. And if it does fail on you, go and look at the topic first, because more often than not your post actually went through fine the first time. If it did not, just re-attach your files and post it again.

As per our own AI rules I will be up front about it. The add-on was written with AI assistance, and so was this post. The digging into what caused it, the testing on the live board and the checking of it are all mine, and I can vouch for what it does. That is the distinction the rules are getting at, writing up work you have actually done rather than pasting out unchecked answers.

Any problems, or if anyone still sees this error, post it up or drop me a message with a rough idea of the time it happened and I will take another look.

Return to “NEWS & ANNOUNCEMENTS”

Who is online

Users browsing this forum: ClaudeBot, jradomski and 6 guests