Page MenuHomePhabricator

Ordering of levels in $wgRestrictionLevels causes bad ordering on protection form
Closed, ResolvedPublic


Reported on enwiki at

Gerrit change 153302 inadvertently changed the ordering of the levels in $wgRestrictionLevels for wikis not using the default levels. For example, on enwiki the array was coming out as

array(5) {

string(14) "templateeditor"
string(0) ""
string(13) "autoconfirmed"
string(5) "sysop"
string(12) "superprotect"


The protection form displays the protection levels in the same order, while admins on-wiki would expect to see "Allow all users" ('') first and "Allow only template editors and admins" ('templateeditor') third.

To get the proper ordering, it looks like we'll have to specify the entire array rather than using the '+' syntax in InitialiseSettings.php.

Version: wmf-deployment
Severity: normal



Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 3:36 AM
bzimport set Reference to bz69640.

Change 154376 had a related patch set uploaded by Anomie:
Fix $wgRestrictionLevels ordering

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

Also affects Portuguese Wikipedia, where the order of the options on
changed from

  1. Default
  2. Allow only autoconfirmed users
  3. Allow only autoreviewer users
  4. Allow only administrators


  1. Allow only autoreviewer users
  2. Default
  3. Allow only autoconfirmed users
  4. Allow only administrators

(In reply to Helder from comment #3)

Also affects Portuguese Wikipedia

True, thanks. Also arwiki, ckbwiki, hewiki, plwiki, rowiki, and testwiki.

Brad proposed change will fix the issue. It is too late for me (10pm) to deploy it right now, so I guess it will be deployed on Monday. Sorry for the delay, I am too paranoid / tired to risk causing some havoc on the cluster =]

Change 154376 merged by jenkins-bot:
Fix $wgRestrictionLevels ordering

I have deployed the change:

$ sync-file wmf-config/InitialiseSettings.php 'Fix $wgRestrictionLevels ordering {{bug|69640}}'
No syntax errors detected in /a/common/wmf-config/InitialiseSettings.php
13:12:34 Started sync-proxies
sync-proxies: 100% (ok: 4; fail: 0; left: 0)
13:12:34 Finished sync-proxies (duration: 00m 00s)
13:12:34 Started sync-apaches
sync-common: 100% (ok: 227; fail: 0; left: 0)
13:12:38 Finished sync-apaches (duration: 00m 03s)
13:12:38 Synchronized wmf-config/InitialiseSettings.php: Fix $wgRestrictionLevels ordering {{bug|69640}} (duration: 00m 04s)

Thank you for the report and thank you Brad for the patch!