Don't assume notable types are returned by Suggest
Freebase Suggest doesn't always return a notable key in its dictionary, so we need to check whether it exits. Fixes issue #636
This commit is contained in:
parent
14c04698e3
commit
6315036c82
@ -326,13 +326,17 @@ DataTableCellUI.prototype._searchForMatch = function(suggestOptions) {
|
|||||||
var match = null;
|
var match = null;
|
||||||
var commit = function() {
|
var commit = function() {
|
||||||
if (match !== null) {
|
if (match !== null) {
|
||||||
|
var notable_types = null;
|
||||||
|
if (match.notable) {
|
||||||
|
notable_types = $.map(match.notable, function(elmt) {
|
||||||
|
return typeof elmt == "string" ? elmt : elmt.id;
|
||||||
|
}).join(",");
|
||||||
|
}
|
||||||
var params = {
|
var params = {
|
||||||
judgment: "matched",
|
judgment: "matched",
|
||||||
id: match.id,
|
id: match.id,
|
||||||
name: match.name,
|
name: match.name,
|
||||||
types: $.map(match.notable, function(elmt) {
|
types: notable_types
|
||||||
return typeof elmt == "string" ? elmt : elmt.id;
|
|
||||||
}).join(",")
|
|
||||||
};
|
};
|
||||||
|
|
||||||
if (elmts.radioSimilar[0].checked) {
|
if (elmts.radioSimilar[0].checked) {
|
||||||
|
Loading…
Reference in New Issue
Block a user