This commit is contained in:
Dan Stillman 2016-10-31 02:28:02 -04:00
parent da7da74986
commit 2c014a9af1

View file

@ -4231,7 +4231,11 @@ Zotero.Item.prototype.toJSON = function (options = {}) {
// Collections // Collections
if (this.isTopLevelItem()) { if (this.isTopLevelItem()) {
obj.collections = this.getCollections().map(function (id) { obj.collections = this.getCollections().map(function (id) {
return this.ContainerObjectsClass.getLibraryAndKeyFromID(id).key; var { libraryID, key } = this.ContainerObjectsClass.getLibraryAndKeyFromID(id);
if (!key) {
throw new Error("Item collection " + id + " not found");
}
return key;
}.bind(this)); }.bind(this));
} }