Page MenuHomePhabricator

Pasting into VE with new Wikitext surface enabled causes error
Closed, ResolvedPublic1 Estimated Story Points


Enable the wikitext editor via $wgVisualEditorEnableWikitext = true;

Edit a page, and try to paste data into it.

See this exception:

ve.ui.DataTransferHandlerFactory.js?15814:129 Uncaught TypeError: Cannot read property 'static' of undefined

pasted_file (217×556 px, 47 KB)

Event Timeline

This is a bug in ve.ce.MWWikitextSurface where I unconditionally unregister ve.ui.MWWikitextStringTransferHandler. The handler should be available in VE, but not NWE.

The way I did this with the other factories was by create wikitext versions of the factories, but this might be overkill for removing/disabling one item.

But also this reveals that unregister isn't working properly in this case - it needs to be overridden to update all the extra caches DTHFactory creates.

Change 306967 had a related patch set uploaded (by Esanders):
Remove items from DTH factory caches when unregistering

Change 306967 merged by jenkins-bot:
Remove items from DTH factory indexes when unregistering