Page MenuHomePhabricator

Special:UserRights should order list of groups alphabetically by label
Open, LowPublic

Description

Currently when you visit Special:UserRights the list of permissions order is a chaos. It'd be good that they appeared in alphabetical order. Thanks.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

+1; I could think they appear in creation order of the permission, but "confirmed user" is almost bottom. Alphabetical order could also help to realize the current names used and to possibly improve translations of the new (or not so new) ones.

Krinkle renamed this task from Special:UserRights: order list of permissions alphabetically to Special:UserRights should order list of groups alphabetically by label .Dec 22 2018, 7:42 AM

For the record T164211, will make this slightly better by making the internal User logic consistently ordered.

Right now the form has no sorting of its own and directly reflects the internal order. Before T164211, this order was undefined and not consistent. After T164211, it will become consistent by group ID (e.g. the group with the English label "Administrator" will sort as "sysop").

This task should result in a patch that sorts it within the user interface by label.

Hello @Krinkle:

T164211: "Conflict of user rights changes! Please review and confirm your changes." in Special:Userrights is marked as fixed, but it didn't really change the display or sorting order from the user point of view. See attached screenshot:

Screenshot 2023-03-28.png (1×1 px, 69 KB)

Would it be possible to look into this task again?

Thanks!

I believe we lack an owner for this component right now, but I'd be happy to guide someone interested in patching this. Anyone interested, claim this task and feel free to add me as reviewer on Gerrit or ask questions here.

To get started, make sure you're logged in as an admin on your local wiki. You can view the list of checkboxes at Special:UserRights/Yourname. This list is rendered as HTML by SpecialUserRights.php in MediaWiki core.

If not too complex, I may be able to try a patch for this. My idea is to alphabetically sort these checkboxes by the localised group-$rightname-member label, case-insensitive.

@Krinkle - So the output at $allgroups = $this->userGroupManager->listAllGroups(); is not sorted, as @Urbanecm kindly tested for me and UserRights displays these the same way (maybe `listAllGroups() could use some sorting, but probably a different Task).

Perhaps a sort ($allgroups) could work here, but it'll only solve the display order for the English UI... Is there any way we can make the generated table content sorted by the localised <label></label> XML value without using JavaScript?

Sorting in SQL (ORDER BY something ASC) could also be an option, assuming it doesn't affect performance too much.

Sorting in SQL (ORDER BY something ASC) could also be an option, assuming it doesn't affect performance too much.

The list of available user groups is a config setting, not something loaded from a database table.

Excellent point. PHP it is then :)