Edgewall Software

Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#10099 closed enhancement (fixed)

Simplify reverting a wiki page to an earlier version

Reported by: Remy Blank Owned by: Remy Blank
Priority: high Milestone: 1.0
Component: wiki system Version:
Severity: normal Keywords:
Release Notes:

wiki: Simplified reverting of a wiki page to an older version.

API Changes:


I may be missing something obvious, but reverting a wiki page to a previous version currently involves the following procedure:

  • Display the version to revert to.
  • Download the source text as "Plain Text".
  • Edit the page, delete the text and paste the downloaded text.

I would have expected that clicking on "Edit this page" on an old version would show the editor with the old text, but this is not the case.

I suggest changing the "Edit this page" button into "Revert to this version" when viewing an old version of a page, and to behave as expected above when that button is clicked.

Patch coming up shortly.

Attachments (1)

10099-wiki-revert-r10656.patch (3.9 KB ) - added by Remy Blank 6 years ago.
Suggested fix.

Download all attachments as: .zip

Change History (5)

comment:1 Changed 6 years ago by Christian Boos

What I usually do is simply to delete the unwanted latest versions.

But it's true that there are situations when the change to revert is not vandalism but simply a wrong information, and restoring the previous content is better accompanied in this case by a comment stating why the change was reverted.

In addition, with alternative TracDev/Proposals//WikiStorage that don't support version deletion, this feature will be the only way to quickly revert vandalism.

Version 0, edited 6 years ago by Christian Boos (next)

Changed 6 years ago by Remy Blank

Suggested fix.

comment:2 Changed 6 years ago by Remy Blank

10099-wiki-revert-r10656.patch changes the "Edit this page" to "Revert to this version" when viewing an older version of a wiki page. When clicking the button, it opens the editor for a new version, with the text from the old version. From there, all the usual operations are possible, like viewing the diff.

(The big hunk in wiki_view.html around the "Delete" button is only a simplification and has nothing to do with this functionality.)

comment:3 Changed 6 years ago by Christian Boos

Looks good, successfully tested.

One thing's missing though: the UEB support! Clicking on the UniversalEditButton makes you edit the latest version, as before. I think that for consistency it should also make you revert to the version being viewed.

  • trac/wiki/templates/wiki_view.html

    diff -r 7c397fb1b559 trac/wiki/templates/wiki_view.html
    a b  
    1212    <title py:if="title">$title</title>
    1313    <meta py:if="version or page.author == 'trac'" name="ROBOTS" content="NOINDEX, NOFOLLOW" />
    1414    <link py:if="admin_perm or (not page.readonly and modify_perm)" rel="alternate" type="application/x-wiki"
    15           title="Edit this page" href="${href.wiki(page.name, action='edit')}" />
     15          title="Edit this page" href="${href.wiki(page.name, action='edit', version=version)}" />
    1616    <script type="text/javascript">
    1717      jQuery(document).ready(function($) {
    1818        $("#content").find("h1,h2,h3,h4,h5,h6").addAnchor(_("Link to this section"));

comment:4 Changed 6 years ago by Remy Blank

Resolution: fixed
Status: newclosed

Good catch! Thanks for testing. I have also changed the title of the link in the case where it would edit an old version of the page.

Patch committed in [10659].

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain Remy Blank.
The resolution will be deleted.
to The owner will be changed from Remy Blank to the specified user.

Add Comment

E-mail address and name can be saved in the Preferences .

Note: See TracTickets for help on using tickets.