Alex Monk has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/327395 )
Change subject: Fix wikitext handling of DataTransferHandlers when IVStore is used ...................................................................... Fix wikitext handling of DataTransferHandlers when IVStore is used Bug: T153269 Change-Id: Ida6ffffac6e6a65784dc84a388d3702680a79db9 (cherry picked from commit c92418e4dae7a77139ebae3a604ce29dab32a448) --- M modules/ve-mw/ui/ve.ui.MWWikitextDataTransferHandlerFactory.js 1 file changed, 6 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor refs/changes/95/327395/1 diff --git a/modules/ve-mw/ui/ve.ui.MWWikitextDataTransferHandlerFactory.js b/modules/ve-mw/ui/ve.ui.MWWikitextDataTransferHandlerFactory.js index 0a2609a..03d9140 100644 --- a/modules/ve-mw/ui/ve.ui.MWWikitextDataTransferHandlerFactory.js +++ b/modules/ve-mw/ui/ve.ui.MWWikitextDataTransferHandlerFactory.js @@ -50,8 +50,12 @@ if ( typeof dataOrDoc === 'string' || ( Array.isArray( dataOrDoc ) && dataOrDoc.every( isPlain ) ) ) { resolve( dataOrDoc ); } else { - doc = dataOrDoc instanceof ve.dm.Document ? dataOrDoc : new ve.dm.Document( dataOrDoc ); - ve.init.target.getWikitextFragment( doc ) + doc = dataOrDoc instanceof ve.dm.Document ? + dataOrDoc : + // The handler may have also written items to the store + new ve.dm.Document( new ve.dm.ElementLinearData( handler.surface.getModel().getDocument().getStore(), dataOrDoc ) ); + + ve.init.target.getWikitextFragment( doc, false ) .done( resolve ) .fail( function () { handler.abort(); -- To view, visit https://gerrit.wikimedia.org/r/327395 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ida6ffffac6e6a65784dc84a388d3702680a79db9 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/VisualEditor Gerrit-Branch: wmf/1.29.0-wmf.5 Gerrit-Owner: Alex Monk <a...@wikimedia.org> Gerrit-Reviewer: Esanders <esand...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits