Page MenuHomePhabricator

Add link to view/restore deleted edits on Special:Upload when a destination filename is provided
Closed, ResolvedPublic

Description

Even without having the +sysop permission, when you click on a URL (such as the
one provided), it will display the text "View or restore deleted edit(s)?," but
only when a filename has been passed through the URL; such as in this example,
with $wpDestFile=Bla.jpg. While clicking on it does return a "Admin only" page,
wouldn't it be better to not display that text at all? When I get to my
MediaWiki installation at work, I'll try to write up a patch and post it here.


Version: unspecified
Severity: enhancement
URL: http://en.wikipedia.org/w/index.php?title=Special:Upload&wpDestFile=Bla.jpg

Details

Reference
bz9002

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 9:34 PM
bzimport set Reference to bz9002.
bzimport added a subscriber: Unknown Object (MLST).

This seems to be produced by a bad template hack on en.wikipedia.org:

http://en.wikipedia.org/wiki/MediaWiki:Uploadtext

If the code produced the link itself, it would be able respond more appropriately.

It would make more sense to have MediaWiki generate that and not a template.
Although, what about the idea of adding a ParserFunction for "ifadmin?"

outputting/omitting text based on user groups can not work with parser cache
enabled. the only possibility i see would be to attach css-classes representing
user groups to the <body> tag. For example, sysops would have the group-sysop
class set there. you could then apply a class like sysops-only to a section of
text, and define styles for those classes in MediaWiki:common.css, to the effect
that the text is hidden to everyone but sysops.

That could work, but I suppose that'd only help for situations when you'd want
it within a template or something. In this particular situation, I think that
this text should be moved to MediaWiki and out of a template.

robchur wrote:

  • Don't use CSS to change the *meaning* of a page
  • It makes sense to introduce the link through software

robchur wrote:

Fixed in r25042, r25043.