[pmwiki-users] Can Foxedit warn of or flag simultaneous edit conflicts?

Hans design5 at softflow.co.uk
Sat Jan 2 05:23:38 CST 2010


I have now released new versions of fox.php and foxedit.php which
will enable simultaneous edit checking. You need to update both.
http://www.pmwiki.org/wiki/Cookbook/Fox
http://www.pmwiki.org/wiki/Cookbook/FoxEdit

I changed the approach outlined previously, and use now Session
variables to save the content of a section or PTVs being edited
at the time the edit form opens. Therefore it is not required
to add hidden fields to the edit form.

From Cookbook.Foxedit:

Checking for simultaneous edits

From version 2001-01-01 FoxEdit and Fox provide for checking of
simultaneous edits. No modifications of foxedit forms should be
necessary. On form submission Fox will compare the text being edited
as it was when the edit form opened with the text as found in the
page. If they are not the same, the page section being edited was
updated in the meantime, and Fox will return the user to the edit
form, but with the newly updated content, not with the content the
user tried to enter. A warning that the content was modified will be
displayed as well.

This check will only involve the actual page section being edited,
other page sections can be edited simultaneously without triggering
such warning. If one or several PTVs are edited, only the PTVs being
edited will be checked. For this to work, the editform needs to
contain the ptvfields= parameter, naming the PTVs being edited (this
is the case with the standard edit forms).

An alternative checking could be made by checking the time of the
last page modification again the time the edit form was opened. Such
check will catch any edits on the page, not just edits concerning the
section or PTVs being targeted. For this more general time check one
needs to add to the fox edit form a hidden input field like this,
which catches the time the edit form opens:
(:input hidden basetime {(ftime %s)}:) 


cheers, and a Happy New Year to all!
  ~Hans




More information about the pmwiki-users mailing list