Fix error when loading a saved search with an empty 'is/isNot' text condition

Fix 'null' appearing in saved search window when editing a search with an empty 'is/isNot' text condition
This commit is contained in:
Dan Stillman 2008-06-03 19:24:42 +00:00
parent e7203d4c67
commit 7471c9dc73
2 changed files with 5 additions and 2 deletions

View File

@ -542,7 +542,9 @@
this.mode = condition['mode']; this.mode = condition['mode'];
this.id('operatorsmenu').value = condition['operator']; this.id('operatorsmenu').value = condition['operator'];
this.value = prefix + condition['value']; this.value = prefix +
(condition.value ? condition.value : '');
this.dontupdate = false; this.dontupdate = false;
} }

View File

@ -1142,7 +1142,8 @@ Zotero.Search.prototype._buildQuery = function(){
case 'isNot': // excluded with NOT IN above case 'isNot': // excluded with NOT IN above
// Automatically cast values which might // Automatically cast values which might
// have been stored as integers // have been stored as integers
if (condition.value.match(/^[1-9]+[0-9]*$/)) { if (condition.value
&& condition.value.match(/^[1-9]+[0-9]*$/)) {
condSQL += ' LIKE ?'; condSQL += ' LIKE ?';
} }
else { else {