Prevent item duplication when moving between subfolders

edited January 22, 2020
Hello!

Is there any means to move an item into another folder, rather than just copy it? Or, ideally, enable a mode where items can only exist in one place?

Currently, the directory tree gets littered with duplicates recording every time an item is moved, which have to be deleted manually. Worse still, if I failed to move the item first, I often accidentally delete the item entirely!

One solution would be to tag items rather than use the folder system, but that seems like a waste.

Thanks a lot, sorry for the trouble!
  • Oh, oops, missed https://forums.zotero.org/discussion/80648 - this should be deleted. I suppose I'll try my hand at plugins.
  • Just to be clear that these aren't duplicates in the technical sense: it's one item that's being displayed in multiple collections.

    You can move instead of copy items between collections using modifier keys while dragging and dropping: "hold down Cmd (Mac) or Shift (Windows/Linux) when dragging items to the new collection." (from https://www.zotero.org/support/collections_and_tags#adding_items_to_collections )

    There is no global setting to change this behavior though, no.
  • Ah, wonderful, I should have RTFM. Thanks!
  • Actually, would it be all too onerous to add a hidden_pref to alter this functionality? Something like

    pref("extensions.zotero.DragAndDropCopy", true),
    defaults/preferences/zotero.js

    It looks like all that's required would be changing lines 425, 472 and 494 in chrome/content/zotero/xpcom/libraryTreeView.js from

    if ((Zotero.isMac && event.metaKey) || (!Zotero.isMac && event.shiftKey)) {

    to something like

    if (((Zotero.isMac && event.metaKey) || (!Zotero.isMac && event.shiftKey)) == Zotero.Prefs.get('DragAndDropCopy')){


    I can make a pull request if it would be helpful, but since there are different codepaths for platforms I can't test on I'm pretty sure I'll screw something up.


  • edited February 5, 2020
    EDIT: dang, please ignore. I just realized I wanted to "move" an item from the top level to a folder. But of course the top level always displays all items, even when they are in subfolders, so of course the item will not disappear as a result of moving. SHIFT + drag between subfolders of the group collection works as expected.

    I think I have a similar problem. I want to move items between folders when I drag-and-drop; I understand that SHIFT + drag should do the trick. This kinda works reliably when I move items in my main library.

    However, SHIFT + drag has no effect when I try to move items between folders belonging to a group; it simply makes a copy in the destination folder, but does not remove the item in the source folder.

    Is there any reason SHIFT + drag is supposed to behave differently in the main collection vs. groups?
Sign In or Register to comment.