If a configuration array is defined in extension.json, array elements cannot currently be overridden by setting values in the corresponding configuration variable, as intended by the array_replace_recursive merge strategy. For example, if extension.json contains:
"PageNetworkOptions": { "value": { ... "groups": { "redlink": { "color": { "background": "lightgrey", "border": "grey", } } } }, "merge_strategy": "array_replace_recursive" },
and LocalSettings.php contains:
$wgPageNetworkOptions = [ 'groups' => [ 'redlink' => [ 'color' => [ 'background' => 'pink' ] ] ] ];
the resulting configuration should have a background color of pink. But, the array elements are currently in the wrong order in ExtensionRegistry.php:
case 'array_replace_recursive': $GLOBALS[$key] = array_replace_recursive( $GLOBALS[$key], $val ); break;
so the values in extension.json have precedence rather than the values in the configuration variable. This is counter the expected behavior that a configuration variable can override values specified in extension.json.
codesearch confirms that this merge strategy is only publicly used by the JsonConfig extension, which does not provide array elements in extension.json, so this change should not affect it. This bug is preventing this merge strategy from having its intended behavior, which is preventing other extensions from being able to take advantage of this functionality.