From 4af862e6d371cc617e601bb473b4cfe048fe5c3c Mon Sep 17 00:00:00 2001 From: Alex Monk Date: Sun, 18 Dec 2016 03:44:22 +0000 Subject: [PATCH] Also allow opening in source mode if VE is unavailable on action=edit Bug: T153508 Change-Id: I5678d3b417c93707edc90bbb76ce4dafcd2098c6 --- .../init/targets/ve.init.mw.DesktopArticleTarget.init.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js b/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js index 2260982c0a..44fb78aaa2 100644 --- a/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js +++ b/modules/ve-mw/init/targets/ve.init.mw.DesktopArticleTarget.init.js @@ -907,7 +907,12 @@ if ( isViewPage && uri.query.veaction in editModes ) { mode = editModes[ uri.query.veaction ]; } else { - if ( init.isWikitextAvailable && getPreferredEditor() === 'wikitext' ) { + if ( init.isWikitextAvailable && ( + getPreferredEditor() === 'wikitext' || ( + !init.isVisualAvailable && + [ 'edit', 'submit' ].indexOf( uri.query.action ) !== -1 + ) + ) ) { mode = 'source'; } else { mode = 'visual';