Last modified: 2007-01-04 07:12:06 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T10351, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 8351 - Undo last edit does not work
Undo last edit does not work
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
History/Diffs (Other open bugs)
unspecified
All All
: Normal normal with 1 vote (vote)
: ---
Assigned To: Nobody - You can work on this!
:
: 8362 8483 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2006-12-21 15:40 UTC by Lejonel
Modified: 2007-01-04 07:12 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Lejonel 2006-12-21 15:40:32 UTC
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).
Comment 1 Lejonel 2006-12-21 16:21:43 UTC
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.
3. 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.
4. 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.
Comment 2 Brion Vibber 2006-12-24 01:53:03 UTC
*** Bug 8362 has been marked as a duplicate of this bug. ***
Comment 3 Brion Vibber 2006-12-24 02:04:27 UTC
Fixed in r18546.
Comment 4 Andrew Garrett 2007-01-04 07:12:06 UTC
*** Bug 8483 has been marked as a duplicate of this bug. ***

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links