mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-15 02:23:58 +00:00
Merge "Set a JS config var to force VisualEditor to edit the current version"
This commit is contained in:
commit
4b6e819440
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue