jenkins-bot has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/342160 )
Change subject: ArticleTarget#switchToVisualEditor: Bail if the server won't
let you switch
......................................................................
ArticleTarget#switchToVisualEditor: Bail if the server won't let you switch
Because otherwise you're just throwing all the user's input on the floor.
Bug: T158692
Change-Id: I5df00842697be11ecde9ea8ba2ab16b0dc90205e
---
M modules/ve-mw/init/ve.init.mw.ArticleTarget.js
1 file changed, 7 insertions(+), 3 deletions(-)
Approvals:
DLynch: Looks good to me, approved
jenkins-bot: Verified
diff --git a/modules/ve-mw/init/ve.init.mw.ArticleTarget.js
b/modules/ve-mw/init/ve.init.mw.ArticleTarget.js
index d265457..f0bbbb8 100644
--- a/modules/ve-mw/init/ve.init.mw.ArticleTarget.js
+++ b/modules/ve-mw/init/ve.init.mw.ArticleTarget.js
@@ -2240,9 +2240,13 @@
var dataPromise, windowManager, switchWindow,
target = this;
- if ( this.section !== null ) {
- // WT -> VE switching is not yet supported in sections, so
- // show a discard-only confirm dialog, then reload the whole
page.
+ // Show a discard-only confirm dialog, and then reload the whole page,
if:
+ if (
+ // * section editing in WT, as WT -> VE is not yet supported, or
+ this.section !== null ||
+ // * the server can't switch for us because that's not
supported.
+ !mw.config.get( 'wgVisualEditorConfig' ).fullRestbaseUrl
+ ) {
windowManager = new OO.ui.WindowManager();
switchWindow = new mw.libs.ve.SwitchConfirmDialog();
$( 'body' ).append( windowManager.$element );
--
To view, visit https://gerrit.wikimedia.org/r/342160
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I5df00842697be11ecde9ea8ba2ab16b0dc90205e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: Jforrester <[email protected]>
Gerrit-Reviewer: Bartosz DziewoĆski <[email protected]>
Gerrit-Reviewer: DLynch <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits