$wgVisualEditorAvailableNamespaces gets cast to an int very early.
Description
Details
Status | Subtype | Assigned | Task | ||
---|---|---|---|---|---|
Resolved | None | T218645 Wikimaniawiki: enable VisualEditor in the "2019:" namespace | |||
Resolved | matmarex | T219562 VE doesn't let you enable it in namespaces whose labels happen to be ints |
Event Timeline
Change 499915 had a related patch set uploaded (by Jforrester; owner: Jforrester):
[operations/mediawiki-config@master] [Wikimania] Enable VisualEditor in the 2019 namespace via ID
Change 499915 merged by jenkins-bot:
[operations/mediawiki-config@master] [Wikimania] Enable VisualEditor in the 2019 namespace via ID
This is because of a limitation of PHP, from https://wiki.php.net/rfc/convert_numeric_keys_in_object_array_casts :
The first of these, the array, is an ordered map of integer or string keys to arbitrary values. There is no overlap between integer and string keys in arrays; if a string fits the format /^(0|(-?[1-9][0-9]*))$/ and is small enough (PHP_INT_MIN ≤ n ≤ PHP_INT_MAX), it is converted to an integer key. Such strings are termed numeric strings.
I wouldn't be surprised if this isn't the only bug caused by a numerical namespace label.
We mostly refer to namespaces by ID in config options, $wgVisualEditorAvailableNamespaces is just weird. We can easily make it check if the value is a valid namespace name first, and if it isn't, then treat it as ID. I have a patch for this but Gerrit just went down.
Change 499945 had a related patch set uploaded (by Bartosz Dziewoński; owner: Bartosz Dziewoński):
[mediawiki/extensions/VisualEditor@master] Treat ambiguous values in $wgVisualEditorAvailableNamespaces as names
Change 499945 merged by jenkins-bot:
[mediawiki/extensions/VisualEditor@master] Treat ambiguous values in $wgVisualEditorAvailableNamespaces as names