create new tag
, view all tags

Bug: Edit after save gives old version

In the alpha from Dec 05 2002 on top of the Aug 2002 beta is causing an edit after saving a page to revert to the version before the save.

  • CGI.pm: 2.89 (the latest from CPAN)
  • Perl: 5.6.1
  • OS: Debian GNU/Linux

Note: I am currently running TWiki with both TWIKIWEB and MAINWEB set to "Main", and have moved the documentation topics formerly in TWiki into a new 'Help' web. So far things are working quite well. Next is to try and get the UserWeb patch to work on the alpha (fingers crossed).

Problem: When I edit a page, TWiki sometimes inserts an old version of the page into the text box to edit. When I preview, it'll show the old version, and saving will overwrite the "real" new version with the "pretend" (but in actuality "old") version.

You can try it out here: http://www.test.theoretic.com/Main/QuickLinksMenu and http://www.test.theoretic.com/Main/Register . Note: you can test it by using the username "TWikiGuest" and password "guest", which I have not removed yet. Hopefully that should work as the registration page suggests.

If the pages don't produce an old version right when you click the edit link, try making a noticable modification to the page then saving, and then come back and click the edit link again. Go ahead to drastically change it and mess around, the wiki is not public yet, so none of my users will be disrupted.

BTW, I'm not using a proxy, and it is producing the same error on the same machine but with Lynx and Netscape 4.75 (I normally use Mozilla).

Seems that TWiki is fetching an old version of the file I'm trying to edit, displaying it in the text box for editing. Also, with the http://www.test.theoretic.com/Main/QuickLinksMenu page, note that when you click the edit link and TWiki produces the old version, it also uses the old version in the page template (the QuickLinksMenu is used at the top of every page for navigation,. take a look). So it's definately a TWiki problem here, not a local caching one.

-- AdamTheo - 07 Dec 2002

Merging the TWiki and Main webs may make upgrades harder - probably best to keep them separate and just do a replacement of the TWiki web when upgrading. The two webs were split a while back for this reason. Renaming the TWiki web is fine of course, something like System or TWikidocs would make sense.

This sounds like a variant of RefreshEditPage, since the error happens on re-visiting the Edit page not the View page - you have the alpha which includes this fix, but it only works if you always click on the Edit link on the new page produced by a Save. If you hit the Back button twice and then hit Edit, all bets are off - the browser may well return a cached version of the Edit page, which is where the problem happens.

This can also happen if you edit page A, then view various other pages, then click on a link to page A, then hit Edit again. If the second visit to page A is served from cache, the Edit link will be identical to the first visit's Edit link. See BrowserIssues for some workarounds that fix this, but note that they may interfere with the fix for IE5's BackFromPreviewLosesText.

Please try to analyse exactly when this happens, and note the final part of the Edit link's URL (t=10039265519 for example). If the t= link changes, the fix for RefreshEditPage is working. Also, your comment and mine should be moved to something like RefreshEditPageCaching and linked to RefreshEditPage.

Better BrowserAndProxyCacheControl on the View page would probably help this - by forcing every View to bypass any cache, this would never happen. However, this would be quite a performance hit. Alternatively, JavaScript could be used to generate the unique Edit URL suffix based on the brower's time of day, rather than the possibly cached time of day from the server. However, avoiding JavaScript is preferable...

-- RichardDonkin - 07 Dec 2002

Hi Richard. This happens even without hitting the back button and then re-editing. I can just save, then when taken back to the view page, hit edit again and the old version will be there. There are no t= parts to the edit URL, never seen anything like that.

UPDATE: I have done some more playing around, and it looks like the RefreshEditPage solution will solve my problem. Chalk this up to me not testing enough before posting it here frown Sorry.

UPDATE: I've implemented the EDITURL variable, and it seems to be working perfectly. sigh so, problem solved. not a new bug.

-- AdamTheo - 07 Dec 2002

Always good to find a fix - which skin are you using? There needs to be better documentation of how to write skins that are proof against RefreshEditPage issues. Also, I think the ViewAfterSaveCachesOldPage issue does need to be fixed, to avoid the consequent RefreshEditPage problems.

-- RichardDonkin - 08 Dec 2002

Test case


TWiki version: alpha dec 2002 on top of beta Aug 2002
TWiki plugins: basic
Server OS: debian gnu/linux
Web server: apache
Perl version: 5.6.1
Client OS: linux
Web Browser: mozilla

-- AdamTheo - 07 Dec 2002

Follow up

Fix record

Edit | Attach | Watch | Print version | History: r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r3 - 2002-12-08 - RichardDonkin
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2018 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.