Clean up a few data layer lines

This commit is contained in:
Dan Stillman 2017-03-09 03:12:14 -05:00
parent b1fc6ac67c
commit f9ea0af4cf
3 changed files with 11 additions and 9 deletions

View File

@ -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

View File

@ -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);
}
});

View File

@ -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;
}
}