From 3c1cdd57d2ad52cc9434b906a469579cb7b850a8 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Tue, 26 Jun 2018 00:47:12 +0200 Subject: [PATCH] Fix error with nested saved searches containing post-search filters Addresses #1518 --- chrome/content/zotero/xpcom/data/search.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/xpcom/data/search.js b/chrome/content/zotero/xpcom/data/search.js index 1642127741..f729b54320 100644 --- a/chrome/content/zotero/xpcom/data/search.js +++ b/chrome/content/zotero/xpcom/data/search.js @@ -1244,7 +1244,11 @@ Zotero.Search.prototype._buildQuery = Zotero.Promise.coroutine(function* () { // -- should probably use a temporary table instead if (hasFilter){ let subids = yield obj.search(); - condSQL += subids.join(); + condSQL += "itemID "; + if (condition.operator == 'isNot') { + condSQL += "NOT "; + } + condSQL += "IN (" + subids.join(); } // Otherwise just put the SQL in a subquery else {