Page MenuHomePhabricator

Special:Undelete does not go to right page if you check the checkbox to adjust revision visibility for a deleted file revision
Open, Needs TriagePublicBUG REPORT

Assigned To
None
Authored By
Bawolff
Tue, Nov 5, 1:15 PM
Referenced Files
F57689907: image.png
Fri, Nov 8, 10:31 PM
F57688919: button.png
Fri, Nov 8, 6:26 AM
F57684382: image.png
Tue, Nov 5, 10:13 PM
F57684384: image.png
Tue, Nov 5, 10:13 PM

Description

Steps to replicate the issue (include links if applicable):

  • Upload some file
  • delete it (normal delete, not revision delete)
  • Make sure you have the user rights to do revision deletion - https://www.mediawiki.org/wiki/Manual:RevisionDelete
  • go to Special:Undelete
  • check the checkbox beside the file revision in the File history section (not the page history)
  • Click the button to change visibility of selected revisions

What happens?:
You get an invalid target revision error. The url looks something like ?title=Special:RevisionDelete&type=revision&&target=File%3AMyFilename.png which is incorrect

What should have happened instead?:
You should go to the correct page (with type=filearchive in the url) OR there should be no checkbox and you should only be able to click on the link.

The correct url should look more like: ?title=Special:RevisionDelete&type=filearchive&target=File%3AMyFile.png&ids=11

The code for this primarily lives in includes/specials/SpecialUndelete.php in mediawiki core

Event Timeline

Thank you for tagging this task with good first task for Wikimedia newcomers!

Newcomers often may not be aware of things that may seem obvious to seasoned contributors, so please take a moment to reflect on how this task might look to somebody who has never contributed to Wikimedia projects.

A good first task is a self-contained, non-controversial task with a clear approach. It should be well-described with pointers to help a completely new contributor, for example it should clearly pointed to the codebase URL and provide clear steps to help a contributor get setup for success. We've included some guidelines at https://phabricator.wikimedia.org/tag/good_first_task/ !

Thank you for helping us drive new contributions to our projects <3

I cannot reproduce this, when clicking "Undelete" it says that the file has been successfully undeleted

image.png (624×1 px, 70 KB)

image.png (211×570 px, 21 KB)

Not that button, the "change visibility" button. It only shows up if your user account has the correct rights, which admins might not have by default.

Try setting in LocalSettings.php

$wgGroupPermissions['user']['deleterevision'] = true; $wgGroupPermissions['user']['deletelogentry'] = true;

Not that button, the "change visibility" button. It only shows up if your user account has the correct rights, which admins might not have by default.

Try setting in LocalSettings.php

$wgGroupPermissions['user']['deleterevision'] = true; $wgGroupPermissions['user']['deletelogentry'] = true;

Oh right, my bad. I tried it again and clicked on the correct link and it leads me to index.php?title=Special:RevisionDelete&type=filearchive&target=File%3ATestFile.png&ids=4 which appears to be the correct URL, according to the task description.

button.png (790×1 px, 108 KB)

I mean the circled button "change visibility of selected revisions", not the text link.

image.png (210×771 px, 29 KB)

To me, it looks like the "Change visibility of selected revisions" button belongs to the "Page history" section and only applies to those revisions. You get the error because you did not select any page history revisions.
For the File history section, you can use the "change visibility" links which work fine for me. I might be wrong though, it would probably be good to have someone review this who has more knowledge about this page.

Right. The point of this bug is it is confusing to have the checkboxes beside the items in the file history section if they do not do anything. They should either be removed or connected to the button.