Page MenuHomePhabricator

Setting wgAddGroups and wgRemoveGroups in extension.json is not supported
Closed, ResolvedPublic

Description

Several extensions specify additions to $wgAddGroups and $wgRemoveGroups in their extension.json. As it stands, this doesn't really work: the merge strategy for both globals is array_merge, which can't be used to merge sub-arrays recursively. So, setting these attributes in extension.json only works when adding values for user groups that did not have anything set previously, but not for merging within the same user group.

This should be easily fixable by changing the merge strategy to array_merge_recursive for both globals. It seems that it was deprecated in T292602 for extensions, but this would be done in core's config schema, so it should be fine.

Event Timeline

Change #1119147 had a related patch set uploaded (by Daimona Eaytoy; author: Daimona Eaytoy):

[mediawiki/core@master] Set correct merge strategy for $wgAddGroups and $wgRemoveGroups

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

Change #1119147 merged by jenkins-bot:

[mediawiki/core@master] Set correct merge strategy for $wgAddGroups and $wgRemoveGroups

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