Fixes #727, Duplicated items lose their creators
This commit is contained in:
parent
ff7919553c
commit
19b8db590f
|
@ -3829,7 +3829,7 @@ Zotero.Item.prototype.clone = Zotero.Promise.coroutine(function* (libraryID, ski
|
|||
// Regular item
|
||||
if (this.isRegularItem()) {
|
||||
yield this.loadCreators();
|
||||
newItem.setCreators(newItem.getCreators());
|
||||
newItem.setCreators(this.getCreators());
|
||||
}
|
||||
else {
|
||||
yield this.loadNote();
|
||||
|
|
|
@ -424,6 +424,23 @@ describe("Zotero.Item", function () {
|
|||
})
|
||||
})
|
||||
|
||||
describe("#clone()", function () {
|
||||
// TODO: Expand to other data
|
||||
it("should copy creators", function* () {
|
||||
var item = new Zotero.Item('book');
|
||||
item.setCreators([
|
||||
{
|
||||
firstName: "A",
|
||||
lastName: "Test",
|
||||
creatorType: 'author'
|
||||
}
|
||||
]);
|
||||
yield item.save();
|
||||
var newItem = yield item.clone();
|
||||
assert.sameDeepMembers(item.getCreators(), newItem.getCreators());
|
||||
})
|
||||
})
|
||||
|
||||
describe("#toJSON()", function () {
|
||||
it("should output only fields with values in default mode", function* () {
|
||||
var itemType = "book";
|
||||
|
|
Loading…
Reference in New Issue
Block a user