Restoring After Using Drafts

Restoring to a prior published state fails after saving drafts and publishing
Restoring to a prior published state fails after saving drafts and publishing

See page history:

  • Published original file with lines 01-10.
  • Added two lines, saved draft.
  • Deleted two lines, saved draft.
  • Modified one line, published.
  • Restored to state after first publish.

We should be back to lines 01-10. Instead, lines 03-04 are missing and lines 05-06 are duplicated.

Line 01 Line 02 Line 03 Line 04 Line 05 Line 06 Line 07 Line 08 Line 09 Line 10

This is a result of the problem described in PITS.01007.

ChuckG

Thanks for showing us this bug. It appears that it comes from the fact that the very last diff PmWiki stores is not between the previous version of the draft and the current posted text (a), but between the previous version of the published page and the posted text (b). So, this is clearly a bug and for the moment I've fixed it in SVN by enabling (a) but I still have to think if there are no side effects. There is another way of dealing with this, suggested on the PITS page, notably dropping all intermediate draft changes and storing a single atomic diff between published versions. One problem with this solution is that information about authors of the draft edits is lost. I'll ask the community how we should deal with it on the mailing lists. You may want to join the [pmwiki-users] list and/or test the SVN pre-release (only scripts/draft.php changed). --Petko July 09, 2013, at 03:15 PM

 0: 00.00 00.00 config start
 1: 00.02 00.01 config end
 2: 00.21 00.21 MarkupToHTML begin
 3: 00.23 00.23 MarkupToHTML end
 4: 00.24 00.23 MarkupToHTML begin
 5: 00.24 00.24 ReadApprovedUrls SiteAdmin.ApprovedUrls begin
 6: 00.25 00.24 ReadApprovedUrls SiteAdmin.ApprovedUrls end
 7: 00.25 00.25 MarkupToHTML end
 8: 00.25 00.25 MarkupToHTML begin
 9: 00.26 00.25 MarkupToHTML end
10: 00.26 00.26 now
Peak memory: 3,763,968 bytes