Clean up a few data layer lines
This commit is contained in:
parent
b1fc6ac67c
commit
f9ea0af4cf
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user