Page MenuHomePhabricator

MediaWiki:Missing-revision should provide link to deleted revision for administrators
Open, MediumPublic

Description

https://en.wikipedia.org/wiki/User:Enterprisey/link-deleted-revs should be a core feature of MediaWiki.

Steps to reproduce: Click https://en.wikipedia.org/w/index.php?title=&oldid=844151270

Expected behavior: Show administrators a link to the deleted revision, or the deleted revision itself.

Current behavior: "The revision #844151270 of the page named "Main Page" does not exist."

Possibly related: T59445

Event Timeline

ToBeFree created this task.Apr 26 2020, 9:11 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptApr 26 2020, 9:11 PM
RhinosF1 added a subscriber: RhinosF1.

Is this an issue with deletion, page history, diffs, or something else? Can’t think where it fits best.

Can the title describe the issue better as well?

  • "Main Page" is incorrect.
  • "Does not exist" is incorrect.
  • Lack of a link to the indeed existing deleted revision is uncomfortable.

I sadly don't know which part of the software causes this incorrect message.

  • "Main Page" is incorrect.
  • "Does not exist" is incorrect.
  • Lack of a link to the indeed existing deleted revision is uncomfortable.

I forgot how bad that message really was. If no one beats me to it, I’ll look at some point tommorow to find what message it is and what code uses it so I can tag better.

If it helps, I can at least note that the system message text comes from here: https://en.wikipedia.org/wiki/MediaWiki:Missing-revision

L235 added a subscriber: L235.Apr 26 2020, 9:30 PM

See also the recent discussion on enwiki which prompted this, and a user script that mitigates this issue: https://en.wikipedia.org/w/index.php?title=Wikipedia:Administrators%27_noticeboard&oldid=953329946#Fun_admin_script.

Aklapper renamed this task from "The revision X of the page named "Main Page" does not exist." to MediaWiki:Missing-revision should provide link to deleted revision for administrators.Apr 27 2020, 8:31 AM
Aklapper removed a project: Platform Engineering.
Aklapper removed a project: MediaWiki-General.
Ammarpad added a subscriber: Ammarpad.
  • "Main Page" is incorrect.

This is because &title= is empty in the request so Main Page is used as fallback. If a permalink contains correct title, main page would not be used.

  • "Does not exist" is incorrect.

All deleted revisions are presumed to "not exist". It's debatable, however, whether that's a fair description or not.

  • Lack of a link to the indeed existing deleted revision is uncomfortable.

I have made a patch that adds a diff link to the message. But you may still see the old message in cases where the "revision does not exist" thing still applies even though the revision may "exists" in theory. But I think it's an improvement overall.

Ammarpad claimed this task.May 4 2020, 7:57 PM
APerson added a comment.EditedMay 5 2020, 6:59 AM

@Ammarpad thank you so much! Two quick questions: Would the diff link appear in all cases where the link-deleted-revs script currently displays it? (That is, can I turn off the script once this change goes live?) Also, how does it deal with two revisions that happened in the same second - would the error page of the later one link you to the diff of the first one?

I've just noticed that T251910 occurs with an existing "title=" parameter. Is it entirely unrelated? I have marked it as parent of this task for now, because I thought it's the "larger issue" behind all this. Feel free to undo.

QEDK added a subscriber: QEDK.May 15 2020, 1:48 PM

I have made a patch that adds a diff link to the message. But you may still see the old message in cases where the "revision does not exist" thing still applies even though the revision may "exists" in theory. But I think it's an improvement overall.

Can you link the patch to this task? I can't see it (or comment/CR etc.).

Change 596683 had a related patch set uploaded (by Ammarpad; owner: Ammarpad):
[mediawiki/core@master] Provide link to view diff of deleted revision in missing-rev message

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

@Ammarpad thank you so much! Two quick questions: Would the diff link appear in all cases where the link-deleted-revs script currently displays it?

Thanks. Generally yes, but I'd not say 'in all cases.' Because in core we're checking permission on the revision itself, the link will only appear when the context user has permission to view the revision in question. I see that the script unconditionally creates the link, so relatively speaking, it 'works' even for non-admin and would create link to suppressed edits for non-oversighters; of course either would eventually lead to a hard permission error message. So that's the difference, I believe.

Also, how does it deal with two revisions that happened in the same second - would the error page of the later one link you to the diff of the first one?

I think such cases are rare, but yes, the link will fallback to the first diff (I don't know whether that is deterministic itself, though). That's a core bug unfortunately as the page we're linking to does not accept revision id (which is guaranteed to be unique) as far as I can see and previous attempts to make it so have been left in limbo for years.

Can you link the patch to this task? I can't see it (or comment/CR etc.).

I was occupied with something elsewhere. I uploaded it now.