www

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

commit 3f475f25b67d931b82cb4e31a71238b9dc36bdb7
parent 2e76fd65848d2eb6fa2d7a8f9899044154d96e90
Author: Dan Stillman <dstillman@zotero.org>
Date:   Fri, 19 Jun 2015 03:50:48 -0400

Include remotely added properties in relations diffs

Diffstat:
Mchrome/content/zotero/xpcom/data/dataObjectUtilities.js | 16++++++++++++++++
1 file changed, 16 insertions(+), 0 deletions(-)

diff --git a/chrome/content/zotero/xpcom/data/dataObjectUtilities.js b/chrome/content/zotero/xpcom/data/dataObjectUtilities.js @@ -401,6 +401,22 @@ Zotero.DataObjectUtilities = { }); } } + for (let pred in data2) { + // Property in first object have already been handled + if (data1[pred]) continue; + + let vals = typeof data2[pred] == 'string' ? [data2[pred]] : data2[pred]; + for (let i = 0; i < vals.length; i++) { + changeset.push({ + field: "relations", + op: "property-member-add", + value: { + key: pred, + value: vals[i] + } + }); + } + } return changeset; },