www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit c6151f959d09ecee6030286a04ec2d3a8da17c17
parent 21cd15b0680617d92624d140fc9e0cd39169ce11
Author: Aurimas Vinckevicius <aurimas.dev@gmail.com>
Date:   Sun, 26 Apr 2015 18:14:38 -0500

Fix relations serialization in Zotero.Item::toJSON()

Diffstat:
Mchrome/content/zotero/xpcom/data/item.js | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/chrome/content/zotero/xpcom/data/item.js b/chrome/content/zotero/xpcom/data/item.js @@ -5062,7 +5062,7 @@ Zotero.Item.prototype.toJSON = function(options) { let uri = Zotero.URI.getItemURI(item); if (obj.relations[pred]) { if (typeof obj.relations[pred] == 'string') { - obj.relations[pred] = [uri]; + obj.relations[pred] = [obj.relations[pred]]; } obj.relations[pred].push(uri) } @@ -5284,7 +5284,7 @@ Zotero.Item.prototype._getRelatedItemsBidirectional = function () { } } } - else if (!related) { + else if (!related.length) { return []; } return related;