Page MenuHomePhabricator

Copy template onto self throws "Cannot add a child to mwTransclusionBlock"
Open, Needs TriagePublic

Description

Found when trying to verify T346853.

From https://wikitech.wikimedia.org/w/index.php?title=Sandbox&oldid=2112964&veaction=edit&safemode=on

  1. Copy template (e.g. double-click "FIXME" in table cell to select then copy to clipboard).
  2. Select a different cell (e.g. click on table header cell).
  3. Select the template again.
  4. Paste.

Expected:
Nothing, no-op. Or, if applied to a case where content differs, for the copied content to appear in stead of the selected.

Actual:
JavaScript error, after which editor behaves oddly. Most interactions are ignored/unresponsive.

Uncaught Error: Cannot add a child to mwTransclusionBlock node
    checkCanInsertNodeType
    pushInsertNodeOp
    processInsert
    processLinearOperation
    calculateTreeOperations