Page MenuHomePhabricator

VisualEditor: Inserting a formula into a block slug throws "Uncaught TypeError: Cannot call method 'getOuterRange' of null"
Closed, ResolvedPublic

Description

screenshot of the error and empty Latex window

Steps to reproduce:

1.Add a bullet list
2.Add a template as a bulleted item
3.Save the page and reopen the editor
4.Go to the next line of the bulleted list (get rid of bullets by pressing return twice)

5.Click on More>Latex

Observed Result:

The latex window is opening up at the right end, where the template is placed.

6.Then if you change the focus by clicking somewhere on the page outside the latex window

Observed Result:

A blank Latex windows is opening up and a uncaught type error appears Uncaught TypeError: Cannot call method 'getOuterRange' of null

If you save the page and go to edit source , you will see empty <math> tag is getting placed


Version: unspecified
Severity: normal
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=62797

Attached:

Screen_Shot_2013-12-10_at_11.52.03_AM.png (690×1 px, 124 KB)

Details

Reference
bz58286

Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 2:39 AM
bzimport set Reference to bz58286.

Created attachment 14050
emtpy <math> tags

Attached:

Screen_Shot_2013-12-10_at_12.23.28_PM.png (500×953 px, 101 KB)

Modification in steps to reproduce:

4.There is an empty bullet place cursor there and then go to More>Latex

It can also be reproduced by adding image in step 2.

This happens because ve.ui.MWMathInspector.prototype.setup assumes that after calling insertContent() to insert a math node, the selection will cover the math node exactly. But in a block slug, that's not true, because fixupInsertion will have amended the insertion to wrap the math node in a paragraph. Then when the selection does not precisely cover a FocusableNode, focusedNode will be null.

  • Bug 62797 has been marked as a duplicate of this bug. ***

This code as of gerrit 126900 is moving back into VE's repo where it needs to be fixed.

Change 126900 had a related patch set uploaded by Esanders:
Create MWLiveExtensionInspector base class

https://gerrit.wikimedia.org/r/126900

Change 126900 merged by jenkins-bot:
Create MWLiveExtensionInspector base class

https://gerrit.wikimedia.org/r/126900

Change 129622 had a related patch set uploaded by Jforrester:
Create MWLiveExtensionInspector base class

https://gerrit.wikimedia.org/r/129622

Change 129622 merged by jenkins-bot:
Create MWLiveExtensionInspector base class

https://gerrit.wikimedia.org/r/129622

Verified the fix in production