Parser functions to determine protection status
Closed, ResolvedPublic

Description

Author: derlay-1

Description:
Currently it's not possible for templates like http://en.wikipedia.org/wiki/Template:Deletedpage to find out if they are transcluded on an unprotected page; such pages should probably be put in a specific category so that they are easy to find and fix. This could be done by having variables (maybe called {{EDITPROTECTION}} and {{MOVEPROTECTION}}) which hold the current protection status.


Version: unspecified
Severity: enhancement

bzimport added a project: MediaWiki-Parser.Via ConduitNov 21 2014, 9:37 PM
bzimport added a subscriber: wikibugs-l.
bzimport set Reference to bz9947.
bzimport created this task.Via LegacyMay 17 2007, 11:21 PM
bzimport added a comment.Via ConduitMay 18 2007, 3:20 AM

titoxd.wikimedia wrote:

That assumes that you know the protection status, which means an extra database query or two on every page view for that particular page.

bzimport added a comment.Via ConduitMay 18 2007, 2:36 PM

ais523 wrote:

(In reply to comment #1)

That assumes that you know the protection status, which means an extra database
query or two on every page view for that particular page.

Pages are viewed much more often than they are protected. So the solution would be to cache it the same way as {{CURRENTHOUR}} is cached (i.e. recalculate it every time the page is purged), and to rerender the page when its protection level is changed (which shouldn't cause much extra query load).

bzimport added a comment.Via ConduitMay 18 2007, 10:03 PM

derlay-1 wrote:

(In reply to comment #1)

That assumes that you know the protection status, which means an extra database
query or two on every page view for that particular page.

I don't see why it would. Protection status is needed even now for the "edit this page" and "move" links (which are changed to "view source" and removed, respectively, when appropriate), so it should be already available for other uses.

Raymond added a comment.Via ConduitJan 8 2009, 4:38 PM
  • Bug 16939 has been marked as a duplicate of this bug. ***
Cenarium added a comment.Via ConduitJan 8 2009, 7:44 PM

In bug:16939, I indicated that variables {{editprotectionlevel}}
and {{moveprotectionlevel}} returning respectively the edit and move protection
level of a page, 'none', 'autoconfirmed' and 'sysop' would be extremely useful in protection tags. A recurring problem on Wikipedia is that protection tags are present on non-protected pages, because protection expired or it was not removed after unprotection. It is detrimental to anon and new users' editing. Currently, the only option to detect this is to add an expiry to the template, but this is largely unreliable and incomplete. Having those variables would make bots' work much more efficient and we could hide the template when incorrect.

Mr.Z-man added a comment.Via ConduitJan 8 2009, 8:18 PM

Note that 'edit' and 'move' are just the default protection types. Technically, they can be removed, or added on to, so it would have to be something more generic, like {{PROTECTIONLEVEL:edit}}. I'm not quite sure how it would make work easier for bots, since bots generally read the raw page text or use the API rather than the parsed text, but it would be good for hiding the template.

Mr.Z-man added a comment.Via ConduitJan 8 2009, 11:23 PM

Done in r45587. Use: {{PROTECTIONLEVEL:edit}} returns the edit protection level for the page its on. Will update documentation on mw.org shortly.

Cenarium added a comment.Via ConduitJan 9 2009, 12:39 AM

Great, thanks.
Having this variable will also allow to categorize pages with incorrect protection templates in specific maintenance categories that bots can patrol.

bzimport added a comment.Via ConduitJan 9 2009, 6:28 AM

Wiki.Melancholie wrote:

*** Bug 11624 has been marked as a duplicate of this bug. ***

Cenarium added a comment.Via ConduitMar 4 2009, 3:22 PM

I've created a related bug 17354, on a magic word {{PROTECTIONEXPIRY:action}} returning the protection expiry for a given action.

Add Comment

Column Prototype
This is a very early prototype of a persistent column. It is not expected to work yet, and leaving it open will activate other new features which will break things. Press "\" (backslash) on your keyboard to close it now.