Last modified: 2009-03-04 15:22:06 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T11947, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 9947 - Parser functions to determine protection status
Parser functions to determine protection status
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Parser (Other open bugs)
unspecified
All All
: Normal enhancement with 2 votes (vote)
: ---
Assigned To: Nobody - You can work on this!
:
: 11624 16939 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-05-17 23:21 UTC by derlay-1
Modified: 2009-03-04 15:22 UTC (History)
5 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description derlay-1 2007-05-17 23:21:56 UTC
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.
Comment 1 Titoxd 2007-05-18 03:20:46 UTC
That assumes that you know the protection status, which means an extra database query or two on every page view for that particular page. 
Comment 2 ais523 2007-05-18 14:36:01 UTC
(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).
Comment 3 derlay-1 2007-05-18 22:03:07 UTC
(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.
Comment 4 Raimond Spekking 2009-01-08 16:38:27 UTC
*** Bug 16939 has been marked as a duplicate of this bug. ***
Comment 5 Cenarium 2009-01-08 19:44:33 UTC
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.
Comment 6 Alex Z. 2009-01-08 20:18:56 UTC
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.
Comment 7 Alex Z. 2009-01-08 23:23:33 UTC
Done in r45587. Use: {{PROTECTIONLEVEL:edit}} returns the edit protection level for the page its on. Will update documentation on mw.org shortly.
Comment 8 Cenarium 2009-01-09 00:39:42 UTC
Great, thanks.
Having this variable will also allow to categorize pages with incorrect protection templates in specific maintenance categories that bots can patrol.
Comment 9 Melancholie 2009-01-09 06:28:43 UTC
*** Bug 11624 has been marked as a duplicate of this bug. ***
Comment 10 Cenarium 2009-03-04 15:22:06 UTC
I've created a related bug 17354, on a magic word {{PROTECTIONEXPIRY:action}} returning the protection expiry for a given action.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links