mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-09-25 11:16:51 +00:00
Merge "Fix preference namespace list to handle duplicates"
This commit is contained in:
commit
a95ffcdc42
|
@ -673,12 +673,12 @@ class ApiVisualEditor extends ApiBase {
|
|||
// 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 ) {
|
||||
return array_unique( array_map( function ( $namespace ) {
|
||||
// Convert canonical namespace names to IDs
|
||||
return is_numeric( $namespace ) ?
|
||||
$namespace :
|
||||
MWNamespace::getCanonicalIndex( strtolower( $namespace ) );
|
||||
}, array_keys( array_filter( $availableNamespaces ) ) );
|
||||
}, array_keys( array_filter( $availableNamespaces ) ) ) );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue