commit 53e40bb0f4d934e9bd7e8daef9c4e9f35fa3adc5
parent e96f09175455e3afe1ee0a4b40628a26b72c2554
Author: Dan Stillman <dstillman@zotero.org>
Date: Mon, 4 May 2015 02:39:12 -0400
Miscellaneous tweaks
Diffstat:
2 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/chrome/content/zotero/xpcom/data/item.js b/chrome/content/zotero/xpcom/data/item.js
@@ -783,7 +783,7 @@ Zotero.Item.prototype.setField = function(field, value, loadIn) {
var fieldID = Zotero.ItemFields.getID(field);
if (!fieldID) {
- throw ('"' + field + '" is not a valid itemData field.');
+ throw new Error('"' + field + '" is not a valid itemData field');
}
if (loadIn && this.isNote() && field == 110) { // title
@@ -1230,7 +1230,7 @@ Zotero.Item.prototype._saveData = Zotero.Promise.coroutine(function* (env) {
sqlColumns.unshift('itemID');
sqlValues.unshift(parseInt(itemID));
- var sql = "INSERT INTO items (" + sqlColumns.join(", ") + ") "
+ let sql = "INSERT INTO items (" + sqlColumns.join(", ") + ") "
+ "VALUES (" + sqlValues.map(function () "?").join() + ")";
var insertID = yield Zotero.DB.queryAsync(sql, sqlValues);
if (!itemID) {
@@ -1242,7 +1242,7 @@ Zotero.Item.prototype._saveData = Zotero.Promise.coroutine(function* (env) {
}
}
else {
- var sql = "UPDATE items SET " + sqlColumns.join("=?, ") + "=? WHERE itemID=?";
+ let sql = "UPDATE items SET " + sqlColumns.join("=?, ") + "=? WHERE itemID=?";
sqlValues.push(parseInt(itemID));
yield Zotero.DB.queryAsync(sql, sqlValues);
@@ -1380,8 +1380,9 @@ Zotero.Item.prototype._saveData = Zotero.Promise.coroutine(function* (env) {
}
let oldParentKey = this._previousData.parentKey;
+ let oldParentItemID;
if (oldParentKey) {
- let oldParentItemID = this.ObjectsClass.getIDFromLibraryAndKey(this.libraryID, oldParentKey);
+ oldParentItemID = this.ObjectsClass.getIDFromLibraryAndKey(this.libraryID, oldParentKey);
if (oldParentItemID) {
let oldParentItemNotifierData = {};
//oldParentItemNotifierData[oldParentItemID] = {};
diff --git a/chrome/content/zotero/xpcom/search.js b/chrome/content/zotero/xpcom/search.js
@@ -653,8 +653,6 @@ Zotero.Search.prototype.search = Zotero.Promise.coroutine(function* (asTempTable
// haven't already been found by the main search
if (joinMode == 'any') {
if (!tmpTable) {
- Zotero.debug('=');
- Zotero.debug(ids);
tmpTable = yield Zotero.Search.idsToTempTable(ids);
}