Follow-up If67bab93: Try to unbreak content model checking more

Some code was expecting an associative array with content model IDs
as keys, and some wwas expecting a numeric array.

Make it work more like namespace checks.

Change-Id: I804db88ed4562a6eea2b6723cb5cc8ae39d7c08f
This commit is contained in:
Alex Monk 2016-06-01 02:58:55 +01:00
parent 1aeedf2f4b
commit e91fd07a5c
2 changed files with 7 additions and 2 deletions

View file

@ -674,12 +674,14 @@ class VisualEditorHooks {
$namespace :
MWNamespace::getCanonicalIndex( strtolower( $namespace ) );
}, array_keys( array_filter( $availableNamespaces ) ) );
$availableContentModels = $veConfig->get( 'VisualEditorAvailableContentModels' );
$enabledContentModels = array_keys( array_filter( $availableContentModels ) );
$vars['wgVisualEditorConfig'] = [
'disableForAnons' => $veConfig->get( 'VisualEditorDisableForAnons' ),
'preferenceModules' => $veConfig->get( 'VisualEditorPreferenceModules' ),
'namespaces' => $enabledNamespaces,
'contentModels' => $veConfig->get( 'VisualEditorAvailableContentModels' ),
'contentModels' => $enabledContentModels,
'signatureNamespaces' => array_values(
array_filter( $enabledNamespaces, 'MWNamespace::wantSignatures' )
),

View file

@ -103,7 +103,10 @@
"Category": true,
"_merge_strategy": "array_plus"
},
"VisualEditorAvailableContentModels": [ "wikitext" ],
"VisualEditorAvailableContentModels": {
"wikitext": true,
"_merge_strategy": "array_plus"
},
"VisualEditorSkinToolbarScrollOffset": [],
"VisualEditorParsoidTimeout": 100,
"VisualEditorUseSingleEditTab": false,