Sort user groups in Special:Listusers
authorMatěj Suchánek <matejsuchanek97@gmail.com>
Sat, 28 Apr 2018 07:55:23 +0000 (09:55 +0200)
committerMatěj Suchánek <matejsuchanek97@gmail.com>
Sat, 28 Apr 2018 08:03:15 +0000 (10:03 +0200)
This is already done in Special:Activeusers (via UsersPager.php).

Also declare the variable.

Change-Id: Ieb2ef14727e7f16a23093ffd36f52c44e5bb197a

includes/specials/SpecialActiveusers.php

index 9028787..0c709af 100644 (file)
@@ -80,10 +80,12 @@ class SpecialActiveUsers extends SpecialPage {
        protected function buildForm() {
                $groups = User::getAllGroups();
 
+               $options = [];
                foreach ( $groups as $group ) {
                        $msg = htmlspecialchars( UserGroupMembership::getGroupName( $group ) );
                        $options[$msg] = $group;
                }
+               asort( $options );
 
                // Backwards-compatibility with old URLs
                $req = $this->getRequest();