Keep old default behavior (to fix other tests)

This commit is contained in:
Abe Jellinek 2026-05-12 10:20:27 -04:00
parent 99d7e8fcca
commit 68519d5713
4 changed files with 9 additions and 9 deletions

View file

@ -1382,10 +1382,15 @@ Zotero.DataObject.prototype._finalizeErase = async function (env) {
Zotero.DataObject.prototype.toResponseJSON = function (options = {}) {
// Default to showing synced properties, since that's what the API does, and this function
// is generally used to emulate the API
options.syncedStorageProperties ??= true;
options.syncedVersionProperty ??= true;
let uri = Zotero.URI.getObjectURI(this);
var json = {
key: this.key,
version: this.clientVersion,
version: options.syncedVersionProperty ? this.version : this.clientVersion,
library: this.library.toResponseJSON({ ...options, includeGroupDetails: false }),
links: {
self: {

View file

@ -244,7 +244,7 @@ Zotero.Group.prototype.toResponseJSON = function (options = {}) {
let uri = Zotero.URI.getGroupURI(this);
return {
id: this.id,
version: this.clientVersion,
version: options.syncedVersionProperty ? this.version : this.clientVersion,
links: {
self: {
href: Zotero.URI.toAPIURL(uri, options.apiURL),

View file

@ -5869,12 +5869,6 @@ Zotero.Item.prototype.toJSON = function (options = {}) {
Zotero.Item.prototype.toResponseJSON = function (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

View file

@ -900,7 +900,8 @@ async function toResponseJSON(dataObjectOrObjects, searchParams) {
let responseJSON = dataObject.toResponseJSONAsync
? await dataObject.toResponseJSONAsync({
apiURL: `http://localhost:${Zotero.Server.port}/api/`,
includeGroupDetails: true
includeGroupDetails: true,
syncedVersionProperty: false,
})
: dataObject;