Fix error in recursiveCollections mode with huge number of subcollections
This commit is contained in:
parent
e6d7ae8e2f
commit
27974791b0
1 changed files with 3 additions and 9 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue