www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit bebf0f223a922e3bea440376d9f073b1d74f7a68
parent daa1a6e8a55811459034b5d0c4ffa0abfbad372e
Author: Dan Stillman <dstillman@zotero.org>
Date:   Fri,  2 Jun 2006 07:11:54 +0000

Fix exception when erasing items and switch to bound parameter


Diffstat:
Mchrome/chromeFiles/content/scholar/xpcom/data_access.js | 10+++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/chrome/chromeFiles/content/scholar/xpcom/data_access.js b/chrome/chromeFiles/content/scholar/xpcom/data_access.js @@ -667,12 +667,12 @@ Scholar.Item.prototype.erase = function(){ Scholar.Collections.get(parentCollectionIDs[i]).removeItem(this.getID()); } - sql += 'DELETE FROM itemCreators WHERE itemID=' + this.getID() + ";\n"; - sql += 'DELETE FROM itemKeywords WHERE itemID=' + this.getID() + ";\n"; - sql += 'DELETE FROM itemData WHERE itemID=' + this.getID() + ";\n"; - sql += 'DELETE FROM items WHERE itemID=' + this.getID() + ";\n"; + sql = "DELETE FROM itemCreators WHERE itemID=?1;\n"; + sql += "DELETE FROM itemKeywords WHERE itemID=?1;\n"; + sql += "DELETE FROM itemData WHERE itemID=?1;\n"; + sql += "DELETE FROM items WHERE itemID=?1;"; - Scholar.DB.query(sql); + Scholar.DB.query(sql, [{'int':this.getID()}]); Scholar.Creators.purge(); try {