As part of on-going optimisation at T169821, I noticed that one of my unmerged commits shows a dirty config diff, whereas the change is meant to be a no-op.
However, the change is not a breakage. It is actually concidentally avoiding a pre-existing bug that was previousliy corrupting the configuration arrays for many wg-variables that contain numerical keys. Typically those that use namespace constants as keys.
Observed problem
The wgNamespacesWithSubpages setting for many wikis has wrongly swapping various boolean true values to 0.
For example, for nlwikibooks the following is relevant from InitialiseSettings.php:
'wgNamespacesWithSubpages' => [ 'default' => [ NS_TALK /* 1 */ => true, NS_USER /* 2 */ => true, NS_USER_TALK /* 3 */ => true, NS_PROJECT /* 4 */ => true, NS_PROJECT_TALK /* 5 */ => true, NS_FILE_TALK /* 7 */ => true, NS_MEDIAWIKI /* 8 */ => true, NS_MEDIAWIKI_TALK /* 9 */ => true, NS_TEMPLATE /* 10 */ => true, NS_TEMPLATE_TALK /* 11 */ => true, NS_HELP /* 12 */ => true, NS_HELP_TALK /* 13 */ => true, NS_CATEGORY_TALK /* 15 */ => true, 100 => true, 101 => true, 102 => true, 103 => true, 104 => true, 105 => true, 106 => true, 107 => true, 108 => true, 109 => true, 110 => true, 111 => true, 112 => true, 113 => true, 114 => true, 115 => true, 116 => true, 117 => true, 118 => true, 119 => true, ], // Wikibooks @{ '+wikibooks' => [ 0 => 1, 8 => 0 ], // @}
The current output as generated in production:
"wgNamespacesWithSubpages": { "0": 1, "8": 0, "9": 1, << Where did you come from? "10": 0, << Where did you come from? "1": true, "2": true, "3": true, "4": true, "5": true, "7": true, "11": true, "12": true, "13": true, "14": true, "15": true, "16": true, "17": true, "100": true, "101": true, "102": true,
Minimal test case
return [ 'wgNamespacesWithSubpages' => [ 'default' => [ ], '+wikisource' => [ 8 => 'x' ], ], ];
"wgNamespacesWithSubpages": { "8": "x", "9": "x" << WAT },