commit f9ea0af4cf74f44127092546abbebd042b10cf7e
parent b1fc6ac67cbb284f619a71cccb2e66c943147651
Author: Dan Stillman <dstillman@zotero.org>
Date: Thu, 9 Mar 2017 03:12:14 -0500
Clean up a few data layer lines
Diffstat:
3 files changed, 11 insertions(+), 9 deletions(-)
diff --git a/chrome/content/zotero/xpcom/data/dataObject.js b/chrome/content/zotero/xpcom/data/dataObject.js
@@ -626,9 +626,7 @@ Zotero.DataObject.prototype.reload = Zotero.Promise.coroutine(function* (dataTyp
}
if (!dataTypes) {
- dataTypes = Object.keys(this._loaded).filter(
- val => this._loaded[val]
- );
+ dataTypes = Object.keys(this._loaded).filter(type => this._loaded[type]);
}
if (dataTypes && dataTypes.length) {
@@ -644,7 +642,7 @@ Zotero.DataObject.prototype.reload = Zotero.Promise.coroutine(function* (dataTyp
});
/**
- * Checks wheteher a given data type has been loaded
+ * Checks whether a given data type has been loaded
*
* @param {String} [dataType=primaryData] Data type to check
* @throws {Zotero.DataObjects.UnloadedDataException} If not loaded, unless the
diff --git a/chrome/content/zotero/xpcom/data/dataObjects.js b/chrome/content/zotero/xpcom/data/dataObjects.js
@@ -473,16 +473,20 @@ Zotero.DataObjects.prototype.loadAll = Zotero.Promise.coroutine(function* (libra
+ (ids && ids.length == 1 ? this._ZDO_object : this._ZDO_objects)
+ " in " + library.name);
- library.setDataLoading(this._ZDO_object);
+ if (!ids) {
+ library.setDataLoading(this._ZDO_object);
+ }
let dataTypes = this.ObjectClass.prototype._dataTypes;
for (let i = 0; i < dataTypes.length; i++) {
yield this._loadDataTypeInLibrary(dataTypes[i], libraryID, ids);
}
- Zotero.debug(`Loaded all ${this._ZDO_objects} in ${library.name} in ${new Date() - t} ms`);
+ Zotero.debug(`Loaded ${this._ZDO_objects} in ${library.name} in ${new Date() - t} ms`);
- library.setDataLoaded(this._ZDO_object);
+ if (!ids) {
+ library.setDataLoaded(this._ZDO_object);
+ }
});
diff --git a/chrome/content/zotero/xpcom/data/item.js b/chrome/content/zotero/xpcom/data/item.js
@@ -804,8 +804,8 @@ Zotero.Item.prototype.setField = function(field, value, loadIn) {
}
if (!Zotero.Date.isSQLDate(value) && !Zotero.Date.isSQLDateTime(value)) {
- Zotero.logError(`Discarding invalid ${field} '${value}' for `
- + `item ${this.libraryKey} in setField()`);
+ Zotero.logError(`Discarding invalid ${Zotero.ItemFields.getName(field)} '${value}' `
+ + `for item ${this.libraryKey} in setField()`);
return false;
}
}