Ignore items in target library trash for cross-library drags
Just don't consider items in the trash to be linked items in item.getLinkedItem(). I'm not totally sure why we didn't do this many years ago, since it's one of the biggest sources of confusion in Zotero. This addresses #1648 and closes #1610, though not by undeleting and overwriting the item in the trash. When deleting an item and then re-dragging it from another library, I think most people would expect the item in the trash to still exist (possibly with notes, etc.), rather than having been automatically restored and overwritten with new data.
This commit is contained in:
parent
6b8bbaf980
commit
2dd16b44d6
3 changed files with 22 additions and 10 deletions
|
@ -573,6 +573,19 @@ describe("Zotero.DataObject", function() {
|
|||
assert.equal(linkedItem.id, item2.id);
|
||||
})
|
||||
|
||||
it("shouldn't return a linked item in the trash in another library", async function () {
|
||||
var group = await getGroup();
|
||||
var item1 = await createDataObject('item');
|
||||
var item2 = await createDataObject('item', { libraryID: group.libraryID });
|
||||
var item2URI = Zotero.URI.getItemURI(item2);
|
||||
|
||||
await item2.addLinkedItem(item1);
|
||||
item2.deleted = true;
|
||||
await item2.saveTx();
|
||||
var linkedItem = await item1.getLinkedItem(item2.libraryID);
|
||||
assert.isFalse(linkedItem);
|
||||
})
|
||||
|
||||
it("shouldn't return reverse linked objects by default", function* () {
|
||||
var group = yield getGroup();
|
||||
var item1 = yield createDataObject('item');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue