jenkins-bot has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/336038 )
Change subject: CodeEditor should fail if WikiEditor is not available
......................................................................
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
---
M CodeEditor.hooks.php
M i18n/en.json
M i18n/qqq.json
3 files changed, 8 insertions(+), 2 deletions(-)
Approvals:
jenkins-bot: Verified
TheDJ: Looks good to me, approved
Jforrester: Looks good to me, but someone else must approve
diff --git a/CodeEditor.hooks.php b/CodeEditor.hooks.php
index fd29fa5..828904e 100644
--- a/CodeEditor.hooks.php
+++ b/CodeEditor.hooks.php
@@ -57,6 +57,8 @@
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;
}
diff --git a/i18n/en.json b/i18n/en.json
index f40ef9f..02b524a 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -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."
}
diff --git a/i18n/qqq.json b/i18n/qqq.json
index d19fabd..234b642 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -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"
}
--
To view, visit https://gerrit.wikimedia.org/r/336038
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I5ce1d436fe1d79abfd2dda5ad7cdd09bbe1ca914
Gerrit-PatchSet: 6
Gerrit-Project: mediawiki/extensions/CodeEditor
Gerrit-Branch: master
Gerrit-Owner: MarkAHershberger <[email protected]>
Gerrit-Reviewer: Jforrester <[email protected]>
Gerrit-Reviewer: Siebrand <[email protected]>
Gerrit-Reviewer: TheDJ <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits