www

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

commit 1b5c7aa6d843449c9d5909ac18a1cffff1339806
parent 9ba3745b943c1a821cd5f7bb0edea7381b23f6e5
Author: Dan Stillman <dstillman@zotero.org>
Date:   Mon, 15 Aug 2016 04:47:34 -0400

Default to showing synced storage properties in Item::toResponseJSON()

toResponseJSON() is usually used to emulate the API, which shows md5/mtime

Also fix passing of options to toJSON() from toResponseJSON()

Diffstat:
Mchrome/content/zotero/xpcom/data/item.js | 8+++++++-
1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/chrome/content/zotero/xpcom/data/item.js b/chrome/content/zotero/xpcom/data/item.js @@ -4247,7 +4247,13 @@ Zotero.Item.prototype.toJSON = function (options = {}) { Zotero.Item.prototype.toResponseJSON = function (options = {}) { - var json = this.constructor._super.prototype.toResponseJSON.apply(this, options); + // Default to showing synced storage properties, since that's what the API does, and this function + // is generally used to emulate the API + if (options.syncedStorageProperties === undefined) { + options.syncedStorageProperties = true; + } + + var json = this.constructor._super.prototype.toResponseJSON.call(this, options); // creatorSummary var firstCreator = this.getField('firstCreator');