Page MenuHomePhabricator

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

Description

  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.

VM3990:9 Uncaught TypeError: Cannot read property 'length' of undefined
    at NewClass._updateGuide (<anonymous>:9:227)
    at NewClass._onZoomEnd (<anonymous>:7:651)
    at NewClass.fire (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

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptFeb 23 2018, 1:18 AM
Restricted Application added a project: Maps. · View Herald TranscriptFeb 23 2018, 1:19 AM
Restricted Application added a project: Discovery. · View Herald TranscriptFeb 23 2018, 1:20 AM
jmatazzoni triaged this task as Normal priority.Feb 27 2018, 12:02 AM

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

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

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

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

Checked the fix in enwiki betalabs.

Etonkovidova closed this task as Resolved.Apr 26 2018, 9:44 PM
Etonkovidova claimed this task.