Fix issues with Wikidata field

This commit is contained in:
Quincy Morgan
2020-09-24 10:27:35 -04:00
parent 9bde5b967c
commit 482d0902ac
2 changed files with 8 additions and 2 deletions

View File

@@ -87,6 +87,10 @@ export default {
languagesToQuery: function() {
return localizer.localeCodes().map(function(code) {
return code.toLowerCase();
}).filter(function(code) {
// HACK: en-us isn't a wikidata language. We should really be filtering by
// the languages known to be supported by wikidata.
return code !== 'en-us';
});
},

View File

@@ -84,8 +84,10 @@ export function uiFieldWikidata(field, context) {
.call(combobox.fetcher(fetchWikidataItems));
combobox.on('accept', function(d) {
_qid = d.id;
change();
if (d) {
_qid = d.id;
change();
}
}).on('cancel', function() {
setLabelForEntity();
});