commit 27974791b0cf909315744b94dd16feaaaa3e1459 parent e6d7ae8e2f7538b7c0e6a9c2e82e5a1b52f5632c Author: Dan Stillman <dstillman@zotero.org> Date: Fri, 27 Jan 2017 12:00:28 -0500 Fix error in recursiveCollections mode with huge number of subcollections Diffstat:
| M | chrome/content/zotero/xpcom/data/search.js | | | 12 | +++--------- |
1 file changed, 3 insertions(+), 9 deletions(-)
diff --git a/chrome/content/zotero/xpcom/data/search.js b/chrome/content/zotero/xpcom/data/search.js @@ -1198,20 +1198,14 @@ Zotero.Search.prototype._buildQuery = Zotero.Promise.coroutine(function* () { } if (objectType == 'collection') { - var q = ['?']; - var p = [obj.id]; + let ids = [obj.id]; // Search descendent collections if recursive search if (recursive){ - var descendents = obj.getDescendents(false, 'collection'); - for (let d of descendents) { - q.push('?'); - p.push(d.id); - } + ids = ids.concat(obj.getDescendents(false, 'collection').map(d => d.id)); } - condSQL += "collectionID IN (" + q.join() + ")"; - condSQLParams = condSQLParams.concat(p); + condSQL += 'collectionID IN (' + ids.join(', ') + ')'; } // Saved search else {