List of steps to reproduce (step by step, including full links if applicable):
- Install a vanilla MediaWiki 1.37.1 on a Linux server, with VisualEditor
- Click "Edit" to edit any page using VisualEditor
- VisualEditor displays the dialog: "Revision IDs returned by the server do not match (document: undefined, metadata: nnn)", where nnn is an integer such as 123.
What happens?:
No pages on the wiki are editable using VisualEditor.
What should have happened instead?:
VisualEditor should edit the page.
Software version (if not a Wikimedia wiki), browser information, screenshots, other information, etc.:
MW 1.37.1, installed using the standard MediaWiki installer.
PHP 7.4.28
Google Chrome on Linux 100.0.4896.75 (Official Build) (x86_64)
Debugging information:
The error is thrown by function ve.init.mw.ArticleTarget.prototype.parseMetadata in extensions/VisualEditor/modules/ve-mw/init/targets/ve.init.mw.ArticleTarget.js. The problem is that this.doc.documentElement.getAttribute( 'about' ) is null, so docRevId remains undefined. What would cause this behavior?
The error message ID is 'visualeditor-loaderror-revidconflict'.
Here is the relevant code:
// `undefined` indicates that the page doesn't exist docRevId = undefined; aboutDoc = this.doc.documentElement && this.doc.documentElement.getAttribute( 'about' ); if ( aboutDoc ) { docRevIdMatches = aboutDoc.match( /revision\/([0-9]*)$/ ); if ( docRevIdMatches.length >= 2 ) { docRevId = parseInt( docRevIdMatches[ 1 ] ); } } // There is no docRevId in source mode (doc is just a string), new visual documents, or when // switching from source mode with changes. if ( this.getDefaultMode() === 'visual' && !( this.switched && this.fromEditedState ) && docRevId !== this.revid ) { if ( this.retriedRevIdConflict ) { // Retried already, just error the second time. this.loadFail( 've-api', { errors: [ { code: 've-api', html: mw.message( 'visualeditor-loaderror-revidconflict', String( docRevId ), String( this.revid ) ).parse() } ] } ); }