Hello MediaWiki Developers,
I'm troubleshooting and have a question regarding to the arrayMerge
function in SiteConfiguration.php.
From my understanding, this function should merge two arrays by
overwriting the values of $array1 with those of $array2 where keys
match. However, it appears that it only overwrites a value if the
existing value in $array1 is false.
This behavior is problematic when attempting to set configuration
options, particularly $wgGroupPermissions, to false. For example, the
default value of $wgGroupPermissions['user'] includes [ 'edit' =>
true, 'read' => true ]. I am unable to set edit to false by merging it
with [ 'edit' => false ] using the current arrayMerge logic.
Here is a configuration snippet from my LocalSettings.php:
$wgConf->settings = [
'+wgGroupPermissions' => [
'default' => [
'*' => [
'autocreateaccount' => true,
'createaccount' => false,
'edit' => false,
'read' => false,
],
'user' => [
'edit' => false,
],
],
'+internalwiki' => [
'user' => [ 'edit' => true ],
],
'+externalwiki' => [
'*' => [ 'read' => true ],
'user' => [ 'edit' => true ],
],
],
];
This can't set, for example, $wgGroupPermissions['*']['read'] to false
for internalwiki. I am looking for advice on how to correctly set some
of these permissions to false as intended.
Thank you for your assistance.