[pmwiki-users] Date problems

Patrick R. Michaud pmichaud at pobox.com
Mon Sep 19 08:10:22 CDT 2005


On Mon, Sep 19, 2005 at 12:59:40PM +0200, Lars Nordgren wrote:
> I really messed things up today.
> The date om my server running the PmWiki software was set 1 month ahead.
> 
> When this was corrected. Nothing can be edited anymore.
> I get the "The page you are editing has been modified since you started 
> editing it." -error message.
> If the date on the server is changed "back to the future" then everything 
> works fine.
> Bu this is not an acceptable solution ;-)
> 
> Is there anything I can do to correct this?

Interesting problem.

One (simple) solution is to turn off simultaneous edit checking
for a month, with

    $EnableSimulEdit = 0;

After a month, when the pages' timestamps are no longer "in the future",
you can turn simultaneous edit checking back on again. 

Or, if you don't want to wait a month, you can turn off simultaneous edit
checking, edit+save each of the pages that had the wrong date in them
(you'll have to make a small change to each) so that they get a correct
date, and then you can turn simultaneous edit checking back on again.

Lastly, you can edit your scripts/simuledit.php file to add the line

     if ($page['time'] > $Now) $page['time'] = $Now;

as the second line of the MergeSimulEdits function; i.e., change

    function MergeSimulEdits($pagename,&$page,&$new) {
      global $EnablePost, $MessagesFmt, $WorkDir, $SysMergeCmd, $Now;
      SDV($SysMergeCmd,"/usr/bin/diff3 -L '' -L '' -L '' -m -E");
      if (@!$_POST['basetime'] || !PageExists($pagename) ||
        $_POST['basetime']>=$page['time']) return;

to

    function MergeSimulEdits($pagename,&$page,&$new) {
      global $EnablePost, $MessagesFmt, $WorkDir, $SysMergeCmd, $Now;
      if ($page['time'] > $Now) $page['time'] = $Now;
      SDV($SysMergeCmd,"/usr/bin/diff3 -L '' -L '' -L '' -m -E");
      if (@!$_POST['basetime'] || !PageExists($pagename) ||
        $_POST['basetime']>=$page['time']) return;

Hope this helps!

Pm




More information about the pmwiki-users mailing list