Page MenuHomePhabricator

MediaWiki interface do not take into account values of $wgRestrictionLevels other than "autoconfirmed" and "sysop"
Closed, ResolvedPublic

Description

After "autoreviewer" was added to $wgRestrictionLevels on ptwiki (see bug 39652), a user noticed[1] some parts of MW interface do not take this new value into account. Digging into the code, I found these problems so far:

  1. On Title.php, isSemiProtected() only consider the level "autoconfirmed"[2]
  2. (Consequently) On EditPage.php, showTextbox1() do not add CSS classes for other semiprotection levels [3]
  3. On Linker.php, formatTemplates() only consider messages [[MediaWiki:template-semiprotected]] and [[MediaWiki:template-protected]], instead of using a convention such as "template-level-<a value from $wgRestrictionLevels here>", similar to the way "MediaWiki:Protect-level-*" and "MediaWiki:Restriction-level-*" works [4][5][6]

There may be other places where the new value is not working either...

[1] https://pt.wikipedia.org/w/index.php?diff=33433428&diffonly=1
[2] https://gerrit.wikimedia.org/r/gitweb?p=mediawiki/core.git;a=blob;f=includes/Title.php;h=a20367dcefb1786bc24a570e6bb983daf293f7ef;hb=HEAD#l2384
[3] https://gerrit.wikimedia.org/r/gitweb?p=mediawiki/core.git;a=blob;f=includes/EditPage.php;h=ad6c98d1108ef4228bf2b02864755936f0725925;hb=HEAD#l2482
[4] https://gerrit.wikimedia.org/r/gitweb?p=mediawiki/core.git;a=blob;f=includes/Linker.php;h=05a9905669f95fcb573f851da6d58bad8a340161;hb=HEAD#l1858
[5] https://gerrit.wikimedia.org/r/gitweb?p=mediawiki/core.git;a=blob;f=includes/specials/SpecialProtectedpages.php;h=74ed5378e4143644cced27858c4248ccbc0b5f51;hb=HEAD#l261
[6] https://gerrit.wikimedia.org/r/gitweb?p=mediawiki/core.git;a=blob;f=includes/ProtectionForm.php;h=e844a1e9ab4dac5a73bd16e0e86ce7f58da470d2;hb=HEAD#l582


Version: 1.21.x
Severity: normal

Details

Reference
bz43462

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 1:09 AM
bzimport set Reference to bz43462.
bzimport added a subscriber: Unknown Object (MLST).
He7d3r created this task.Dec 27 2012, 2:25 PM

This should be reasonably easy to do - +keyword:easy.

Another issue – there is no protection information on the transclusion list below edit form. https://en.wikipedia.org/wiki/File:No_(protected_template).png

Change 90551 had a related patch set uploaded by Anomie:
Use restriction-level-* messages in Linker::formatTemplates

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

Change 90552 had a related patch set uploaded by Anomie:
Add $wgSemiprotectedRestrictionLevels

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

Change 90551 merged by jenkins-bot:
Use restriction-level-* messages in Linker::formatTemplates

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

Change 90552 merged by jenkins-bot:
Add $wgSemiprotectedRestrictionLevels

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

Both patches are now merged. The changes should be deployed to WMF wikis with 1.23wmf1, see https://www.mediawiki.org/wiki/MediaWiki_1.23/Roadmap for the schedule.

Note that this doesn't actually change the "autoreviewer" protection level on ptwiki to be considered semiprotected, it just makes it possible to do so. If you want that done, please follow the instructions at https://meta.wikimedia.org/wiki/Requesting_wiki_configuration_changes to file a new bug requesting that autoreviewer be added to $wgSemiprotectedRestrictionLevels for ptwiki.

From the description[1] of this new $wgSemiprotectedRestrictionLevels, isn't the "semiprotection" only for automatically granted rights which are in $wgAutopromote? (this is not the case of ptwiki's "autoreviewer", which is granted only after requested[2])

[1] https://gerrit.wikimedia.org/r/#/c/90552/4/includes/DefaultSettings.php,unified

[2] https://pt.wikipedia.org/wiki/Wikipedia:Pedidos/Autorrevisor

It being in $wgAutopromote is a good indicator that the protection level could be considered "semi-protection", but it's not necessary. If the right is granted on request with minimal qualifications, it could still be considered "semi-protected". In the end, it's up to the ptwiki community whether they look at it that way or not.

Currently, it looks like the only differences caused by adding a protection level to $wgSemiprotectedRestrictionLevels are:

  • The message "semiprotectedpagewarning" is displayed instead of "protectedpagewarning" when editing the page.
  • The message "semiprotectedpagemovewarning" is displayed instead of "protectedpagemovewarning" when moving the page.
  • The textarea gets class "mw-textarea-sprotected" instead of "mw-textarea-protected" when editing or moving the page.