Feature request: Cannot view source of old revisions
Open, LowPublic

Description

If I go to https://en.m.wikipedia.org/w/index.php?title=User:Jdlrobson&direction=next&oldid=470478968 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
URL: http://www.google-melange.com/gci/task/view/google/gci2013/5902377194356736

Details

Reference
bz54484
bzimport raised the priority of this task from to Low.
bzimport set Reference to bz54484.

bingle-admin wrote:

Prioritization and scheduling of this bug is tracked on Mingle card https://mingle.corp.wikimedia.org/projects/mobile/cards/1252

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

Qgil added a comment.Dec 15 2013, 7:41 AM

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:
https://en.m.wikipedia.org/w/index.php?title=San_Francisco&oldid=582487722

Qgil added a comment.Dec 16 2013, 6:36 PM

(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

https://gerrit.wikimedia.org/r/103334

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:

http://en.m.wikipedia.beta.wmflabs.org/w/index.php?title=Forty-seven_Ronin&oldid=52226&mobileaction=beta

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

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

https://gerrit.wikimedia.org/r/103334

I documented this on
https://www.mediawiki.org/wiki/Mobile/Release_history#Beta

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.

Restricted Application added a project: Readers-Web-Backlog. · View Herald TranscriptApr 8 2015, 7:17 AM
Jdlrobson set Security to None.
Jdlrobson edited projects, added MobileFrontend; removed Readers-Web-Backlog.
Restricted Application added a project: Readers-Web-Backlog. · View Herald TranscriptApr 10 2015, 5:59 PM
Restricted Application added a project: Readers-Web-Backlog. · View Herald TranscriptApr 10 2015, 5:59 PM
Volker_E removed MSyed as the assignee of this task.Jan 5 2017, 8:58 PM
Volker_E edited projects, added MobileFrontend; removed Design.
MaxSem removed a subscriber: MaxSem.Jan 5 2017, 9:13 PM
Jdforrester-WMF added a subscriber: Jdforrester-WMF.

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

Qgil removed a subscriber: Qgil.Jan 16 2017, 11:51 PM
Jdlrobson updated the task description. (Show Details)
Restricted Application added a subscriber: TerraCodes. · View Herald TranscriptApr 24 2017, 4:56 PM