diff --git a/modules/ve-mw/init/targets/ve.init.mw.DesktopWikitextArticleTarget.js b/modules/ve-mw/init/targets/ve.init.mw.DesktopWikitextArticleTarget.js index 19d2837409..30de109249 100644 --- a/modules/ve-mw/init/targets/ve.init.mw.DesktopWikitextArticleTarget.js +++ b/modules/ve-mw/init/targets/ve.init.mw.DesktopWikitextArticleTarget.js @@ -277,7 +277,8 @@ ve.init.mw.DesktopWikitextArticleTarget.prototype.restoreEditSection = function ve.init.mw.DesktopWikitextArticleTarget.prototype.getWikitextFragment = function ( doc, useRevision ) { var promise, xhr, params = { - action: 'visualeditor', + action: 'visualeditoredit', + token: this.editToken, paction: 'serialize', html: ve.dm.converter.getDomFromModel( doc ).body.innerHTML, page: this.pageName @@ -294,10 +295,10 @@ ve.init.mw.DesktopWikitextArticleTarget.prototype.getWikitextFragment = function ); promise = xhr.then( function ( response ) { - if ( response.visualeditor ) { - return response.visualeditor.content; + if ( response.visualeditoredit ) { + return response.visualeditoredit.content; } - return $.Deferred.reject(); + return $.Deferred().reject(); } ); promise.abort = function () {