CodeEditor should fail if WikiEditor is not available

Instead of quietly failing, code should prompt the user to install
WikiEditor.

Bug: T67072
Change-Id: I5ce1d436fe1d79abfd2dda5ad7cdd09bbe1ca914
This commit is contained in:
Mark A. Hershberger 2017-02-04 16:35:13 -05:00 committed by Jforrester
parent be65f2fe94
commit db76c1b19a
3 changed files with 8 additions and 2 deletions

View file

@ -57,6 +57,8 @@ class CodeEditorHooks {
if ( $lang && $output->getUser()->getOption( 'usebetatoolbar' ) ) {
$output->addModules( 'ext.codeEditor' );
$output->addJsConfigVars( 'wgCodeEditorCurrentLanguage', $lang );
} elseif ( !ExtensionRegistry::getInstance()->isLoaded( "WikiEditor" ) ) {
throw new ErrorPageError( "codeeditor-error-title", "codeeditor-error-message" );
}
return true;
}

View file

@ -16,5 +16,7 @@
"codeeditor-gotoline-placeholder": "line[:column]",
"codeeditor-gotoline-prompt": "Enter a line number",
"codeeditor-indent": "Indent",
"codeeditor-outdent": "Outdent"
"codeeditor-outdent": "Outdent",
"codeeditor-error-title": "Dependency failed",
"codeeditor-error-message": "CodeEditor needs WikiEditor to be loaded."
}

View file

@ -19,5 +19,7 @@
"codeeditor-gotoline-placeholder": "Placeholder for goto line prompt's input",
"codeeditor-gotoline-prompt": "Label for goto line prompt",
"codeeditor-indent": "Used as a label for toolbar button to indent text in the editor",
"codeeditor-outdent": "Used as a label for toolbar button to outdent text in the editor"
"codeeditor-outdent": "Used as a label for toolbar button to outdent text in the editor",
"codeeditor-error-title": "Used as a title when there is a missing dependency",
"codeeditor-error-message": "Explains the dependency on WikiEditor"
}