Page MenuHomePhabricator

Page preview stopped working when it contains a map and user has "preview without reload" enabled
Open, NormalPublic

Description

A few days ago, per report on RU wiki, if a page contains a map, and the user has enabled Editing / Show previews without reloading the page in their preferences, the page crashes after the second page preview.

@Vort has reported that the issue is here:

mw.hook('wikipage.content').add(function($content){var mapsInArticle=[],promises=[];$.each(maps,function(){

maps.pop().remove();  // <-- missing remove

});$content.find('.mw-kartographer-map').each(function(){var data,container=this,$container=$(this),deferred=$.Deferred();data=getMapData(container);if(data){mapsInArticle.push(initMapBox(data,$container));promises.push(deferred.promise());}});$.when(promises).then(function(){mw.hook('wikipage.maps')

stacktrace:

VM85:108 Uncaught TypeError: Cannot read property 'remove' of undefined

   at <anonymous>:108:689
   at Function.each (load.php?debug=false&lang=ru&modules=ext.CodeMirror.lib|jquery%2Cmapbox%2Coojs-ui-core%2Coojs-ui-widgets|oojs-ui.styles.icons-editing-advanced&skin=vector&version=0tjdd2i:259)
   at <anonymous>:108:658
   at fire (load.php?debug=false&lang=ru&modules=ext.CodeMirror.lib|jquery%2Cmapbox%2Coojs-ui-core%2Coojs-ui-widgets|oojs-ui.styles.icons-editing-advanced&skin=vector&version=0tjdd2i:300)
   at Object.fireWith (load.php?debug=false&lang=ru&modules=ext.CodeMirror.lib|jquery%2Cmapbox%2Coojs-ui-core%2Coojs-ui-widgets|oojs-ui.styles.icons-editing-advanced&skin=vector&version=0tjdd2i:302)
   at Object.fire (<anonymous>:4:11)
   at <anonymous>:498:556
   at fire (load.php?debug=false&lang=ru&modules=ext.CodeMirror.lib|jquery%2Cmapbox%2Coojs-ui-core%2Coojs-ui-widgets|oojs-ui.styles.icons-editing-advanced&skin=vector&version=0tjdd2i:300)
   at Object.fireWith [as resolveWith] (load.php?debug=false&lang=ru&modules=ext.CodeMirror.lib|jquery%2Cmapbox%2Coojs-ui-core%2Coojs-ui-widgets|oojs-ui.styles.icons-editing-advanced&skin=vector&version=0tjdd2i:302)
   at Object.deferred.(/w/anonymous function) [as resolve] (https://ru.wikipedia.org/w/load.php?debug=false&lang=ru&modules=ext.CodeMirror.lib%7Cjquery%2Cmapbox%2Coojs-ui-core%2Coojs-ui-widgets%7Coojs-ui.styles.icons-editing-advanced&skin=vector&version=0tjdd2i:305:603)

Event Timeline

Yurik created this task.Dec 4 2018, 12:42 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptDec 4 2018, 12:42 AM
Mholloway triaged this task as Normal priority.Dec 4 2018, 3:42 PM
Mholloway edited projects, added Maps (Kartographer); removed Maps.
Mholloway moved this task from Unsorted to General on the Maps (Kartographer) board.