diff --git a/ApiVisualEditor.php b/ApiVisualEditor.php index b7c53302d5..f42b976240 100644 --- a/ApiVisualEditor.php +++ b/ApiVisualEditor.php @@ -669,7 +669,10 @@ class ApiVisualEditor extends ApiBase { * @return array */ public static function getAvailableNamespaceIds( Config $config ) { - $availableNamespaces = $config->get( 'VisualEditorAvailableNamespaces' ); + $availableNamespaces = + // Note: existing numeric keys might exist, and so array_merge cannot be used + (array) $config->get( 'VisualEditorAvailableNamespaces' ) + + (array) ExtensionRegistry::getInstance()->getAttribute( 'VisualEditorAvailableNamespaces' ); return array_map( function ( $namespace ) { // Convert canonical namespace names to IDs return is_numeric( $namespace ) ?