Page MenuHomePhabricator

Undo last edit does not work
Closed, ResolvedPublic

Description

The new undo function does not work for the last edit of a page. When using the
undo function, the edit page says "Undo succeeded" but the text of the current
revision is loaded into the edit box. So no changes are made to the page when
saving (and the undo does not succeed).


Version: unspecified
Severity: normal

Details

Reference
bz8351

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 9:30 PM
bzimport set Reference to bz8351.
bzimport added a subscriber: Unknown Object (MLST).

The problem is not only with the last edit. Old edits that has the same result
as the current edit will cause the same bug. Here is an example:

  1. User A vandalises the beginning of a page
  2. User B vandalises a different part of the page. This does not interfere with

the first edit.

  1. User C undoes the second vandalism. This does not interfere with the first

edit, but the resulting page is the same as that of vandlism 1.

  1. User D cannot undo the first vandalism.

I think the problem is in the getContent() function in the EditPage class. This
test is true when User D tries to undo the first edit:

#No use doing a merge if it's just a straight revert.
if ($currev_text != $undorev_text) {

$result = wfMerge($undorev_text, $oldrev_text, $currev_text, $text);

} else {

$result = true;

}

In my example a merge needs to be done. The test should check if $undo_rev is
the same as $current_rev (not if the texts are the same). And if undo_rev is
current_rev, $text needs to be assigned.

  • Bug 8362 has been marked as a duplicate of this bug. ***
  • Bug 8483 has been marked as a duplicate of this bug. ***