Incomplete release of deleted item IDs
I've run into a small bug affecting drag-and-drop between libraries. Here's a recipe for reproducing it.
You will need the following items:
- An open Firefox with Zotero installed
- A local collection under My Library
- A group library under Group Libraries, and a group collection within it
- One item in the group collection
Making the bug:
- Drag the item from the group collection to the local collection, and release the mouse button
- Confirm that the item is shown in the local collection
- Right-click on the item in the local collection, select "Delete Selected Item from Library"
- At the prompt ("Are you sure you want to delete the selected item?") click on OK.
- Drag the item from the group collection to the local collection (again), and release the mouse button.
- Observe that the target local collection does not highlight, and that releasing the mouse button does not drop the item into the collection.
Stepping around the bug:
- Click on the Trash collection.
- Right-click over the Trash collection, select "Empty Trash", and click.
- At the prompt ("Are you sure you want to permanently remove items in the Trash?") click on OK.
- Drag the item from the group collection to the local collection (a third time), and release the mouse button.
- Observe that everything works correctly, and that the item now appears in the local collection.
You will need the following items:
- An open Firefox with Zotero installed
- A local collection under My Library
- A group library under Group Libraries, and a group collection within it
- One item in the group collection
Making the bug:
- Drag the item from the group collection to the local collection, and release the mouse button
- Confirm that the item is shown in the local collection
- Right-click on the item in the local collection, select "Delete Selected Item from Library"
- At the prompt ("Are you sure you want to delete the selected item?") click on OK.
- Drag the item from the group collection to the local collection (again), and release the mouse button.
- Observe that the target local collection does not highlight, and that releasing the mouse button does not drop the item into the collection.
Stepping around the bug:
- Click on the Trash collection.
- Right-click over the Trash collection, select "Empty Trash", and click.
- At the prompt ("Are you sure you want to permanently remove items in the Trash?") click on OK.
- Drag the item from the group collection to the local collection (a third time), and release the mouse button.
- Observe that everything works correctly, and that the item now appears in the local collection.
In my case, I would have wanted to finalize the deletion from the library, and copy in the new item, and mark's suggestion of just wiping out the existing item would have worked just fine. But ...
It's a tricky one, isn't it. The copy lurking in trash could have edits or attachments that the user wants to retain, and that conflict with state of the copy he's aiming to drag in from elsewhere. Seems like (as Dan suggests) offering to restore the item from trash, with a warning that the outside item will not be copied in, and that emptying the trash will clear the way for a proper copy action, is about as far as it's safe to go. That way nothing gets deleted without the user going through the usual steps to effect a complete delete and purge. It would also provide a little reminder that the trash should be emptied from time to time. :)
In my case, I would have had to back out and empty the trash, and then copy the item across afresh with its attachment (just as I did do), but I would have known what to do at each step, and had an opportunity to compare and think about the state of the source and target items.