Page MenuHomePhabricator

Feature request: Cannot view source of old revisions
Closed, ResolvedPublic


If I go to and click the edit icon I see the wikitext of the latest revision not the one I'm viewing.

Acceptance criteria

  • If oldid is present in the URL, the EditorOverlay receives this as a parameter
  • If oldid is passed to the EditorOverlay then this is passed to EditorGateway
  • If oldid is passed to EditorGateway, getContent returns the wikitext of that page --------------------------

Version: unspecified
Severity: enhancement



Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 2:12 AM
bzimport set Reference to bz54484.

bingle-admin wrote:

Prioritization and scheduling of this bug is tracked on Mingle card

Would be good to get a version of this in beta.

The related Google Code-in task written by Jon specifies that this is only about viewing source, not saving changes. Why?

Reverting vandalism or dummy mistakes is a task that could be perfectly done via mobile, provided a simple way to access the previous version of a poage, the possibility open the editor in an old version, and save it as the new version.

Desktop doesn't allow you to save a revision and in my opinion this is not a good idea. You would not be reverting a revision you would be re-writing the entire content - imagine loading up the first revision of a page and saving that!

Adding reversion would be another enhancement request - this is simply about being able to see the underlying wikitext on a page like this:

(In reply to comment #4)

Desktop doesn't allow you to save a revision

In Desktop you can open any revision, click "Edit" or "Edit source", and directly save changes. All you get in the way is a warning message:

"Warning: You are editing an out-of-date revision of this page. If you save it, any changes made since this revision will be lost."

When it comes to deal with vandalism, many times it is not possible to simply "undo". The way for regular editors to solve this is to go to the last valid revision and save it.

imagine loading up the first revision of a page and saving that!

If this is wrong, probably a human or a bot will act on it with a simple "undo".

I'm only saying that the desktop behavior could be simply replicated in mobile. If you are concerned about extra vandalism caused by this feature, an option could be to start trying with e.g. autoconfirmed users, which are the ones that tend to fix this kind of messes.

One step at a time Quim... :) This bug is simply about exposing the wikitext - a simple baby step in that direction - feel free to raise an enhancement request when we have that to add additional workflows as this would require significantly more work.

Hmm, so from what I can see, Jon's proposal/request:

  • If oldid parameter is present in the url and edit mode is entered
    • Display a header at the top saying that the user is viewing an old revision
    • Display the standard editor <textarea>, but with the disabled attribute (copy and paste/etc still works, just not modifiable)
      • The text in the textarea will be that of the old revision, obtained by passing the rvstartid parameter in the api request in EditorApi.js
    • Hide the continue button (and just show the cancel link)

For the steps involving disabling the textarea and hiding the "continue", I
imagine this should probably be done by adding a new *viewOnly* option to the
editor (which in the future could definitely be extended to protected pages and
the like, which mirrors behavior on desktop).

Have I missed anything?

Pretty much.
If oldid is present show a 'view source' link that when clicked loads the existing editing without a save button - user can only exist.

I'd use the name readOnly rather than viewOnly.

It's worth noting the overlay code is currently being overhauled so this should be restricted to the beta mode of the mobile site (append mobileaction=beta to end of the URL - you will notice the search now says Search <Project> (Beta))

How do I go about restricting it?

Never mind, I believe I see what needs to be done. Thanks!

I'll try to have an initial patch for this ready tonight/tomorrow, depending on holiday plans.

Change 103334 had a related patch set uploaded by Theopolisme:
View source of old revisions

Update: Thanks to @Theopolisme we (almost) now have a version of this in beta. It would be good to get some design input so that this can be styled correctly and pushed to stable.

When this finally gets merged you'll be able to see this when logged in by going to:

Notice the 'view source' link and what happens when you click it.

Change 103334 merged by jenkins-bot:
View source of old revisions

I documented this on

We will need a design before we can anything further with this.

Please have Kenan prioritize this in the mobile backlog.

Since this is in beta marking as assigned.

Volker_E edited projects, added MobileFrontend; removed Design.
Jdforrester-WMF added a subscriber: Jdforrester-WMF.

As this is blocked on a design, I'll tag it appropriately.

matmarex added a subscriber: matmarex.

I think there is no reason to keep this task open after nearly five years. The feature implemented by @Theopolisme in 2013 – or perhaps some descendant of it – is clearly live in production today. (Unfortunately I have no idea when it was promoted out of beta.)

en.m.wikipedia.org_w_index.php_title=User_Jdlrobson&direction=next&oldid=470478968(iPhone 6_7_8).png (1×750 px, 46 KB)