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) {
|
if (!dataTypes) {
|
||||||
dataTypes = Object.keys(this._loaded).filter(
|
dataTypes = Object.keys(this._loaded).filter(type => this._loaded[type]);
|
||||||
val => this._loaded[val]
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dataTypes && dataTypes.length) {
|
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
|
* @param {String} [dataType=primaryData] Data type to check
|
||||||
* @throws {Zotero.DataObjects.UnloadedDataException} If not loaded, unless the
|
* @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)
|
+ (ids && ids.length == 1 ? this._ZDO_object : this._ZDO_objects)
|
||||||
+ " in " + library.name);
|
+ " in " + library.name);
|
||||||
|
|
||||||
library.setDataLoading(this._ZDO_object);
|
if (!ids) {
|
||||||
|
library.setDataLoading(this._ZDO_object);
|
||||||
|
}
|
||||||
|
|
||||||
let dataTypes = this.ObjectClass.prototype._dataTypes;
|
let dataTypes = this.ObjectClass.prototype._dataTypes;
|
||||||
for (let i = 0; i < dataTypes.length; i++) {
|
for (let i = 0; i < dataTypes.length; i++) {
|
||||||
yield this._loadDataTypeInLibrary(dataTypes[i], libraryID, ids);
|
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)) {
|
if (!Zotero.Date.isSQLDate(value) && !Zotero.Date.isSQLDateTime(value)) {
|
||||||
Zotero.logError(`Discarding invalid ${field} '${value}' for `
|
Zotero.logError(`Discarding invalid ${Zotero.ItemFields.getName(field)} '${value}' `
|
||||||
+ `item ${this.libraryKey} in setField()`);
|
+ `for item ${this.libraryKey} in setField()`);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user