[pmwiki-users] Help! :-( Form Data Being Posted 2-3 times
ben at interdependentweb.com
Mon Aug 6 09:52:59 CDT 2007
> I have a ZAP form. very simple. it posts 5 short strings of text to
> PTV's onto
> a new page...(a To Do form) that's all...the Group.Name of the new page
> are dynamically generated from the text string of the group from
> which the TODO was submitted and the $name of the new page
> is a thread number 4-digit integer
> It is site wide in the Site.AllGroupsFooter and after upgrading to
> 2.2.0-beta-62, on a single submit, the post "operation" is being run twice.
> We get two identical new pages with the same data.
> Further more, where previously the page from which the data was posted
> would update immediately and return a page list with the newly created
> page which would automatically appear "runtime" at the top of the page inthe
> Site.PageTopMenu, The page is now, no longer being updated. If I try to reload at this
> point by clicking "reload" PMwiki beta 62 seems to have "cached"
> the Post "directive" andI get the screen:
> "Confirm: The page you are trying to view contains POSTDATA that has
> expired from Cache. if you resend the data, any action the form carried
> out (such as a search or online purchase) will be repeated. To resend
> the data, click OK. Otherwise, click Cancel"
> If I click OK it get yet a third instance of the new page...
> TODO-Donations.1001 # these two created initially on first, single, submit
> TODO-Donations.1002 # created on attempt to reload the page.
I'm just guessing here, but I think you're getting two posts the first
time because, if I understand what you're saying, you're using (:zap
nextpage:) to redirect to another page which also has the same ZAP form
on it, thanks to your Site.AllGroupsFooter. So the ZAP instructions are
being processed both before and after the redirection. If this is the
case, one solution is to put (:nogroupfooter:) (or whatever the
equivalent is for AllGroupsFooter) on the page you're redirecting to.
Another solution is to have the form submit its contents to the page
where you want people to end up (:zapform action=Target.Page:) instead
of submitting to the current page and then redirecting. (Use (:zap
datapage:) to indicate where the data should be stored.) Either way,
you want to make sure the ZAP instructions only get processed once
instead of twice!
This same problem may also be preventing the redirected page from
loading correctly because it's trying to redirect to itself! So if you
fix that, the page may go back to loading correctly.
However, it certainly may be the case that beta 62 is caching
differently from previous versions. You might try enabling IMS caching
and see if that helps, but I suspect your problem is with the ZAP form
and not with PmWiki.
Hope this helps! --Ben S.
More information about the pmwiki-users