[pmwiki-devel] Multiple Posts in ZAP

Ben Stallings Ben at InterdependentWeb.com
Mon Apr 30 15:31:20 CDT 2007


Dan wrote:
> I've noticed sometimes with ZAP users submit multiple copies of a
> post.  It seems to happen when one hits the back button or a reload
> button.  I'm wondering
> 
> 1) If this ever happens in Fox, and if not, what Fox does to prevent this.
> 2) Why it's happening in the first place and how to fix it.

I think what you're seeing is a consequence of the fact that PmWiki 
disables browser caching.  Here's the sequence of events, which can 
happen with any PmWiki form, with one exception described below:

1) user loads page with form on it
2) user submits form with POST data
3) user navigates to another page
4) user hits the back button to see the previous page again

At this point, the browser will display a warning that the page has 
"expired from cache" and that asking whether the user wants to "resubmit 
POST data," baffling many users, and giving only the options Yes or 
Cancel, neither of which does what the user wanted, which was to see 
what was on the page *without* resubmitting the data.  If the user 
chooses Cancel, s/he sees that the desired result was not achieved, and 
so hits Back again and chooses Yes this time, resubmitting the form.

It's not just a newbie problem, either: I often use the Save and Edit 
option when editing pages and so get multiple copies of the edit form in 
my browser history, each with different POST data associated with it. 
When navigating back to an edit form, I have to remember to pull down 
the menu and select the first one, which had no POST data.  This is 
counterintuitive, since one would expect the first one to have the 
original, unmodified data in it, and only the most recent copy of the 
page to have the most recent data.  And indeed, if caching is allowed, 
that is exactly what those cached pages contain.  But with caching 
disabled, the earliest page in the list loads the current data!  It 
takes a little getting used to.

Two solutions I can think of: one is to enable IMScaching so that the 
browser doesn't have to reload the page in order to display it.  I 
haven't actually tried it myself, but it's worth a try.  The other 
solution is to refresh the page so that the POST data is not associated 
with it in the browser history; PmWiki does this when you click Save 
instead of Save and Edit (the exception I alluded to above).

Of course there's also the possibility that some of your users just 
double-click everything out of habit, including form buttons.  I have 
some of those, and if they are a representative sample of the 
Internet-using public, there must be millions of them out there.  The 
easiest solution to that problem is a simple javascript that disables 
buttons the moment they're clicked.  Maybe I'll add that to the 
FormExtensions recipe.

Hope this was helpful and not too pedantic.  --Ben



More information about the pmwiki-devel mailing list