Page MenuHomePhabricator

Entering VisualEditor while a DT widget containing content is open prevents saving in VE
Open, Needs TriagePublicBUG REPORT

Description

Steps to replicate the issue (include links if applicable):

  • Enable the 2017 wikitext editor for your account (this isn't necessary, but it makes it much easier to trigger the issue because of how few pages with DT can be edited in visual mode)
  • Visit a talk page such as https://en.wikipedia.org/wiki/Talk:Battle_of_the_Saw
  • Open a reply widget and enter some text in it (the text is required; this doesn't happen with an empty widget)
  • Without closing the widget, click "edit source" in the header to open the 2017 wikitext editor
  • Click the "publish changes" button in the toolbar

What happens?:
Nothing visibly happens. The console contains the following error:

Uncaught TypeError: ve.init.target.isSaveable is not a function
    at ve.ui.MWSaveCommand.isExecutable (<anonymous>:364:810)
    at ve.ui.Command.execute (/w/load.php?lang=en&modules=ext.visualEditor.core%2Cmwtransclusion&skin=vector-2022&version=4qxmi:637:703)
    at /w/load.php?lang=en&modules=ext.visualEditor.core%2Cmwtransclusion&skin=vector-2022&version=4qxmi:627:24
    at fire (/w/load.php?lang=en&modules=ext.discussionTools.init%7Cjquery%2Coojs-ui-core&skin=vector-2022&version=1d3nb:347:934)
    at Object.add [as done] (/w/load.php?lang=en&modules=ext.discussionTools.init%7Cjquery%2Coojs-ui-core&skin=vector-2022&version=1d3nb:348:454)
    at ve.ui.Tool.onSelect (/w/load.php?lang=en&modules=ext.visualEditor.core%2Cmwtransclusion&skin=vector-2022&version=4qxmi:626:989)
    at OO.ui.ToolGroup.onMouseKeyUp (<anonymous>:1213:413)
    at HTMLDivElement.dispatch (/w/load.php?lang=en&modules=ext.discussionTools.init%7Cjquery%2Coojs-ui-core&skin=vector-2022&version=1d3nb:371:260)
    at elemData.handle (/w/load.php?lang=en&modules=ext.discussionTools.init%7Cjquery%2Coojs-ui-core&skin=vector-2022&version=1d3nb:367:877)

Examining ve.init.target while in the 2017 editor reveals that it's a CommentTarget.

What should have happened instead?:

The targets shouldn't have been mixed up.

Event Timeline

I'd need to do a bit more testing to distinguish between this being ve.init.target not being replaced by the editor setup versus the DT autosave reinitializing it in the background and clobbering the editor's target.

@DLynch: are you still experiencing this issue? I have not yet been able to reproduce it...

@ppelberg I am, though it doesn't seem to happen on every pageload. It's possible it requires some state that I've not accounted for properly in the task description...