From 4ffaaa9eeaba81a42d6bca63fba19cf5fc73ed01 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Tue, 27 Feb 2007 20:45:41 +0000 Subject: [PATCH] Addresses #346, mapping for new item types Fix for base field not being included (only type-specific fields) when searching by a base field --- chrome/content/zotero/xpcom/search.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/chrome/content/zotero/xpcom/search.js b/chrome/content/zotero/xpcom/search.js index 7771e837d..015514218 100644 --- a/chrome/content/zotero/xpcom/search.js +++ b/chrome/content/zotero/xpcom/search.js @@ -582,9 +582,14 @@ Zotero.Search.prototype._buildQuery = function(){ break; } + // Add base field + condSQLParams.push( + Zotero.ItemFields.getID(condition['alias']) + ); var typeFields = Zotero.ItemFields.getTypeFieldsFromBase(condition['alias']); if (typeFields) { - condSQL += 'fieldID IN ('; + condSQL += 'fieldID IN (?,'; + // Add type-specific fields for each(var fieldID in typeFields) { condSQL += '?,'; condSQLParams.push(fieldID); @@ -594,9 +599,6 @@ Zotero.Search.prototype._buildQuery = function(){ } else { condSQL += 'fieldID=? AND '; - condSQLParams.push( - Zotero.ItemFields.getID(condition['alias']) - ); } break;