Allow &veaction=editsource to load 2017WTE regardless of user prefs

Bug: T239796
Change-Id: I0391d44d15763980cfb48b2945bac35e5b08e930
This commit is contained in:
Bartosz Dziewoński 2024-08-26 19:55:55 +02:00
parent d9c7c05e32
commit c93d4a9695
2 changed files with 9 additions and 10 deletions

View file

@ -30,12 +30,8 @@
const url = new URL( location.href );
// Provide the new wikitext editor
if (
conf.enableWikitext &&
(
mw.user.options.get( 'visualeditor-newwikitext' ) ||
url.searchParams.get( 'veaction' ) === 'editsource'
) &&
mw.loader.getState( 'ext.visualEditor.mwwikitext' )
mw.user.options.get( 'visualeditor-newwikitext' ) ||
url.searchParams.get( 'veaction' ) === 'editsource'
) {
modules.push( 'ext.visualEditor.mwwikitext' );
}

View file

@ -1351,11 +1351,14 @@
init.isWikitextAvailable = (
init.isAvailable &&
// Enabled on site
conf.enableWikitext &&
// If forced by the URL parameter, skip the checks (T239796)
( url.searchParams.get( 'veaction' ) === 'editsource' || (
// Enabled on site
conf.enableWikitext &&
// User preference
mw.user.options.get( 'visualeditor-newwikitext' ) &&
// User preference
mw.user.options.get( 'visualeditor-newwikitext' )
) ) &&
// Only on wikitext pages
mw.config.get( 'wgPageContentModel' ) === 'wikitext'