Merge pull request #568 from metamaps/fix/import-export

use Wildcard if no metacode
This commit is contained in:
Devin Howard 2016-07-26 08:05:00 +08:00 committed by GitHub
commit 17bccd809a

View file

@ -266,7 +266,10 @@ Metamaps.Import = {
var self = Metamaps.Import
$(document).trigger(Metamaps.Map.events.editedByActiveMapper)
var metacode = Metamaps.Metacodes.where({name: metacode_name})[0] || null
if (metacode === null) return console.error('metacode not found')
if (metacode === null) {
metacode = Metamaps.Metacodes.where({ name: 'Wildcard' })[0]
console.warn("Couldn't find metacode " + metacode_name + ' so used Wildcard instead.')
}
var topic = new Metamaps.Backbone.Topic({
name: name,