Page MenuHomeMiraheze

Add way to rename user groups in ManageWiki
Open, LowPublic

Description

Currently the only way to 'rename' a user group is to manually copy overall permissions and delete the original group. Needless to say, this is unnecessarily tedious and there should be a built-in way to do it.

Event Timeline

BrandonWM lowered the priority of this task from Normal to Low.Mar 19 2023, 06:01
BrandonWM added a project: ManageWiki.

Groups can be renamed by editing the relevant MediaWiki pages. If you mean changing the underlying name, this is not something that you are supposed to do; in the 20 years of MediaWiki history I can count the number of times this has happened on one hand

Groups can be renamed by editing the relevant MediaWiki pages. If you mean changing the underlying name, this is not something that you are supposed to do; in the 20 years of MediaWiki history I can count the number of times this has happened on one hand

Out of curiosity, why is it not supposed to be done? Changing user group names could be beneficial because of typos or something of the sort.

Because it's how the group is referenced by code, this means changing that means changing any scripts looking for it, changing every reference to that group in the database, basically anything that points to it, plus it's not really seen by end-users anyway. It could probably be a numeric identifier, but it's not.

In theory, renaming the group should be as simple as:

UPDATE user_groups SET ug_group="newname" WHERE ug_group="oldname";
UPDATE user_former_groups SET ufg_group="newname" WHERE ufg_group="oldname";

But I'd have to double check the database schema to verify that these are the only two places where user groups are tracked.

For now though, I'd absolutely recommend using the MediaWiki:Grouppage-<group>, MediaWiki:Group-<group> and MediaWiki:Group-<group>-member interface messages to customize the display of the group.

@Void No, there are more places and even if you changed those you can't change external places where it's used (i.e. scripts that people make). Like I said before this happens once in a blue moon and when it does happen it's usually for a technical reason. A good example of this is https://phabricator.wikimedia.org/T112147 - and even when it is necessary, a huge amount of disruption was caused. That's why it's generally recommended not to do that, especially when the point is just to change the display name, which you can already do via MediaWiki pages

Groups can be renamed by editing the relevant MediaWiki pages. If you mean changing the underlying name, this is not something that you are supposed to do; in the 20 years of MediaWiki history I can count the number of times this has happened on one hand

Out of curiosity, why is it not supposed to be done? Changing user group names could be beneficial because of typos or something of the sort.

This exactly why I would like this feature.

@Void No, there are more places and even if you changed those you can't change external places where it's used (i.e. scripts that people make). Like I said before this happens once in a blue moon and when it does happen it's usually for a technical reason. A good example of this is https://phabricator.wikimedia.org/T112147 - and even when it is necessary, a huge amount of disruption was caused. That's why it's generally recommended not to do that, especially when the point is just to change the display name, which you can already do via MediaWiki pages

But the current solution is to hand-copy it - which produces more disruption.

there are more places

Such as? I'm not really aware of any. At most there might be some finicky business with sysop or autoconfirmed, but given that ManageWiki allows one to delete these groups already, I don't see any particular reason why we should prevent renaming from being an option. Same with external references such as scripts. Most global references that are important (such as Abuse Filters) were modified to search for user rights instead of groups years ago for this reason. Additionally, the upstream task you linked really only seems like it caused trouble due to WMF developers effectively forcing a technical change that the community did not support. In fact the only technical challenge that I was not already aware of that the task brought to light was:

The problem with just renaming groups is that all the old log entries point to the old group.

More interesting to me is the existence of the migrateUserGroup.php script, which would either be what we'd use for this, or a variation of the same.

In T10626#214191, @Void wrote:

there are more places

Such as? I'm not really aware of any. At most there might be some finicky business with sysop or autoconfirmed, but given that ManageWiki allows one to delete these groups already, I don't see any particular reason why we should prevent renaming from being an option. Same with external references such as scripts. Most global references that are important (such as Abuse Filters) were modified to search for user rights instead of groups years ago for this reason. Additionally, the upstream task you linked really only seems like it caused trouble due to WMF developers effectively forcing a technical change that the community did not support. In fact the only technical challenge that I was not already aware of that the task brought to light was:

The problem with just renaming groups is that all the old log entries point to the old group.

More interesting to me is the existence of the migrateUserGroup.php script, which would either be what we'd use for this, or a variation of the same.

@Void Thanks! I would give this comment an award if the option existed.

Yes the log entries do but like I said before the other issue is that anything external would be looking for the old groups, like user scripts, scrapers, or just links.

The group identifier is, well, an identifier and inherently changing that will cause issues in any piece of software, not just MediaWiki.

If people really want to rename them, maybe forgo custom names entirely then, with the internal name being managewikigroup-01, managewikigroup-02 etc, then change the DISPLAY name which is what you want to change anyway. Would this be a good idea?