Don't send inPublications=false in 'full' mode for group items
This commit is contained in:
parent
f0b7a212e5
commit
88a6e4f79f
2 changed files with 12 additions and 3 deletions
|
@ -4347,7 +4347,9 @@ Zotero.Item.prototype.toJSON = function (options = {}) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// My Publications
|
// My Publications
|
||||||
if (this._inPublications || mode == 'full') {
|
if (this._inPublications
|
||||||
|
// Include in 'full' mode, but only in My Library
|
||||||
|
|| (mode == 'full' && this.library && this.library.libraryType == 'user')) {
|
||||||
obj.inPublications = this._inPublications;
|
obj.inPublications = this._inPublications;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1369,11 +1369,18 @@ describe("Zotero.Item", function () {
|
||||||
assert.notProperty(json, "inPublications");
|
assert.notProperty(json, "inPublications");
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should include inPublications=false for items not in My Publications in full mode", function* () {
|
it("should include inPublications=false for personal-library items not in My Publications in full mode", async function () {
|
||||||
var item = createUnsavedDataObject('item');
|
var item = createUnsavedDataObject('item', { libraryID: Zotero.Libraries.userLibraryID });
|
||||||
var json = item.toJSON({ mode: 'full' });
|
var json = item.toJSON({ mode: 'full' });
|
||||||
assert.property(json, "inPublications", false);
|
assert.property(json, "inPublications", false);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("shouldn't include inPublications=false for group items not in My Publications in full mode", function* () {
|
||||||
|
var group = yield getGroup();
|
||||||
|
var item = createUnsavedDataObject('item', { libraryID: group.libraryID });
|
||||||
|
var json = item.toJSON({ mode: 'full' });
|
||||||
|
assert.notProperty(json, "inPublications");
|
||||||
|
});
|
||||||
})
|
})
|
||||||
|
|
||||||
describe("'full' mode", function () {
|
describe("'full' mode", function () {
|
||||||
|
|
Loading…
Add table
Reference in a new issue