Fix "too many SQL variables" error syncing many item removals from a collection

This commit is contained in:
Dan Stillman 2009-07-22 09:07:39 +00:00
parent 04660acbd1
commit 51f79ad627

View file

@ -514,10 +514,8 @@ Zotero.Collection.prototype.save = function () {
if (removed.length) {
var sql = "DELETE FROM collectionItems WHERE collectionID=? "
+ "AND itemID IN ("
+ removed.map(function () '?').join()
+ ")";
Zotero.DB.query(sql, [collectionID].concat(removed));
+ "AND itemID IN (" + removed.join() + ")";
Zotero.DB.query(sql, collectionID);
}
if (newids.length) {