Fix relations serialization in Zotero.Item::toJSON()
This commit is contained in:
parent
21cd15b068
commit
c6151f959d
|
@ -5062,7 +5062,7 @@ Zotero.Item.prototype.toJSON = function(options) {
|
||||||
let uri = Zotero.URI.getItemURI(item);
|
let uri = Zotero.URI.getItemURI(item);
|
||||||
if (obj.relations[pred]) {
|
if (obj.relations[pred]) {
|
||||||
if (typeof obj.relations[pred] == 'string') {
|
if (typeof obj.relations[pred] == 'string') {
|
||||||
obj.relations[pred] = [uri];
|
obj.relations[pred] = [obj.relations[pred]];
|
||||||
}
|
}
|
||||||
obj.relations[pred].push(uri)
|
obj.relations[pred].push(uri)
|
||||||
}
|
}
|
||||||
|
@ -5284,7 +5284,7 @@ Zotero.Item.prototype._getRelatedItemsBidirectional = function () {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (!related) {
|
else if (!related.length) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
return related;
|
return related;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user