I'm writing a script in Perl using the TWiki modules. I'm able to do everything as described in the documentation, however I can't seem to get the version of the document to increase as I edit.

Here's a general flow of how I edit the document:

  1. Check for an edit lock using TWiki::Func::checkTopicEditLock
  2. Lock the document using TWiki::Func::setTopicEditLock
  3. Read the text using TWiki::Func::readTopicText (not passing a revision parameter so that it assumes the top-level revision)
  4. Modify the text in various ways, including updating the meta-data with an incremented version number (using TWiki::Func::getRevisionInfo to get the current revision)
  5. Write back the updated text using TWiki::Func::saveTopicText

After this procedure, the twiki is definitely updated, however the revision stays the same. If the initial revision is 1.5, and I update the meta-data to 1.6, the revised page still appears as version 1.5 when viewing it on the web. The next time I do a TWiki::Func::getRevisionInfo, the revision is returned as 1.5 again.

I think I must be missing something...is there something extra that has to be done to make TWiki do a diff and update the revision?

-- PaulKrizak - 20 Apr 2004

Paul, the easy answer is to set your $TWiki::doKeepRevIfEditLock to "0" in the TWikiDotCfg file. This will affect all your users however. Otherwise, we'd need to add yet another parameter to the save functions (I think) - which will take a bit of mucking about

-- SvenDowideit - 21 Apr 2004

So this is a known limitation of the TWiki:: perl modules? If so, then that's fine; I just wanted to make sure I was doing everything "right"

-- PaulKrizak - 22 Apr 2004 - 14:47

- Y, its supposedly a feature but many of us turn it off on the grounds that it is counter-intuitive. -- MartinCleaver - 22 Apr 2004 - 16:33

Edit | Attach | Watch | Print version | History: r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r4 - 2004-04-22 - MartinCleaver
 
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-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.