Page MenuHomePhabricator

[betalabs] VE crashes for "Draw a polyline" option
Closed, ResolvedPublic


  1. In betalabs insert <mapframe> element, e.g.
<mapframe text="Downtown [[wikipedia:San Francisco|San Francisco]]" width=250 height=250 zoom=1 latitude=37.8013 longitude=-122.3988 />
  1. In VE click to edit Map and select the option "Draw a polyline"
  1. Draw a line and click on the popup option label ⧼leafletdraw-draw-toolbar-finish-text⧽
  1. Click Done - the following error will be displayed and VE crashes - not responding to any action. Need to reload the page.

Screen Shot 2018-02-21 at 5.32.53 PM.png (610×1 px, 417 KB)

VM3990:9 Uncaught TypeError: Cannot read property 'length' of undefined
    at NewClass._updateGuide (<anonymous>:9:227)
    at NewClass._onZoomEnd (<anonymous>:7:651)
    at (load.php?debug=false&lang=en&modules=mapbox&skin=vector&version=0j9jq4y:9)
    at NewClass._updateZoomLevels (load.php?debug=false&lang=en&modules=mapbox&skin=vector&version=0j9jq4y:56)
    at NewClass._removeZoomLimit (load.php?debug=false&lang=en&modules=mapbox&skin=vector&version=0j9jq4y:56)
    at NewClass.onRemove (load.php?debug=false&lang=en&modules=mapbox&skin=vector&version=0j9jq4y:64)
    at NewClass.removeLayer (load.php?debug=false&lang=en&modules=mapbox&skin=vector&version=0j9jq4y:55)
    at NewClass.removeFrom (load.php?debug=false&lang=en&modules=mapbox&skin=vector&version=0j9jq4y:53)
    at NewClass.remove (load.php?debug=false&lang=en&modules=mapbox&skin=vector&version=0j9jq4y:53)
    at NewClass.remove (load.php?debug=false&lang=en&modules=mapbox&skin=vector&version=0j9jq4y:38)

Event Timeline

Depressing finding: the crash happens while removing the map in the dialog, which happens while closing/tearing down the dialog. For some reason, removing a map that has a polyline drawn on it fails.

Change 428025 had a related patch set uploaded (by Catrope; owner: Catrope):
[mediawiki/extensions/Kartographer@master] Patch leaflet.draw-src.js to fix another JS error

Turns out this was just a case of an event handler that was bound but never unbound.

Change 428025 merged by jenkins-bot:
[mediawiki/extensions/Kartographer@master] Patch leaflet.draw-src.js to fix another JS error

Checked the fix in enwiki betalabs.

Etonkovidova claimed this task.