Merge "Set a JS config var to force VisualEditor to edit the current version"

This commit is contained in:
jenkins-bot 2023-06-14 01:56:12 +00:00 committed by Gerrit Code Review
commit 4b6e819440
2 changed files with 3 additions and 3 deletions

View file

@ -73,7 +73,7 @@ ve.init.mw.ArticleTarget = function VeInitMwArticleTarget( config ) {
// Sometimes we actually don't want to send a useful oldid
// if we do, PostEdit will give us a 'page restored' message
// Use undefined instead of 0 for new documents (T262838)
this.requestedRevId = mw.config.get( 'wgRevisionId' ) || undefined;
this.requestedRevId = mw.config.get( 'wgEditLatestRevision' ) ? mw.config.get( 'wgCurRevisionId' ) : mw.config.get( 'wgRevisionId' ) || undefined;
this.currentRevisionId = mw.config.get( 'wgCurRevisionId' ) || undefined;
this.revid = this.requestedRevId || this.currentRevisionId;

View file

@ -761,8 +761,8 @@
// T156998: Don't trust 'oldid' query parameter, it'll be wrong if 'diff' or 'direction'
// is set to 'next' or 'prev'.
oldId = mw.config.get( 'wgRevisionId' ) || $( 'input[name=parentRevId]' ).val();
// wgFlaggedRevsEditLatestRevision is set by FlaggedRevs extension when viewing a stable revision
if ( oldId === mw.config.get( 'wgCurRevisionId' ) || mw.config.get( 'wgFlaggedRevsEditLatestRevision' ) ) {
// TODO: remove wgFlaggedRevsEditLatestRevision
if ( oldId === mw.config.get( 'wgCurRevisionId' ) || mw.config.get( 'wgEditLatestRevision' ) || mw.config.get( 'wgFlaggedRevsEditLatestRevision' ) ) {
// The page may have been edited by someone else after we loaded it, setting this to "undefined"
// indicates that we should load the actual latest revision.
oldId = undefined;