While looking over the patch for T346052: SiteConfiguration should not assume array with numerical keys is a list (https://gerrit.wikimedia.org/r/c/mediawiki/core/+/956018), I discovered another case in which a wiki-specific config override value would itself get overridden by a less-specific config value: where an array value (for a non-numeric key) is false.
} elseif ( $out[$key] === false ) { // A non-numerical key is taken and holds a false value, // allow it to be overridden always. This exists mainly for the purpose // merging permissions arrays, such as $wgGroupPermissions. $out[$key] = $value; }
As a result of this, when using the following (example) config...
'default' => [ 'foo' => true, 'bar' => true, ] '+examplewiki' => [ 'bar' => false, ]
...the effective configuration for examplewiki would actually currently evaluate to:
"wgExampleConfigVariableName": { "bar": true, "foo": true }
(ie., the 'bar' => false wiki-specific override is discarded by MediaWiki in favour of the default 'bar' => true value.)
Maybe I'm missing something, or there's a case that hasn't yet occurred to me; but at first glance, this behaviour seems counter-intuitive? I don't currently understand why false override-values for non-numerical keys should be 'allow[ed] to be overridden always'.
ccing @Func, @Krinkle & @daniel as folks involved in the discussion on https://gerrit.wikimedia.org/r/c/mediawiki/core/+/956018.