[ZotFile] Renaming attachment removes file

edited March 24, 2021
Hi,

When I rename an attachment, the file is deleted. Could you please have a look at this issue?

Here is some information about the system, steps to reproduce the problem and what I observe.

OS: Ubuntu 20.04.2 LTS
Zotero: 5.0.96
Zotfile: 5.0.16-fx

ZotFile Preferences:
- "Source Folder..." is empty
- "Custom Location" is selected. The field after it is empty.

How to reproduce the issue:
1 - open Zotero
2 - unfold an item to see its attachments
3 - right-click on a linked attachment
4 - select "Manage Attachments" > "Rename Attachments"
5 - answer "OK" to "Do you want to move and rename 1 attachments?"
6 - the following is observed:
6.1 - the new name shown in Zotero for the linked attachment is correct
6.2 - the corresponding file does not exist neither under its original name nor the new name on the original folder
6.3 - "Help" > "Report Errors" reports no error
7 - right-click on the rename linked attachment or in the item name, or double click on the rename linked attachment
8 - the following is observed:
8.1 - no context menu is shown, no file is opened
8.2 - "Help" > "Report Errors reports":
[JavaScript Error: "Component returned failure code: 0x80520001 (NS_ERROR_FILE_UNRECOGNIZED_PATH) [nsIFile.initWithPath]" {file: "chrome://zotero/content/xpcom/file.js" line: 47}]
[JavaScript Error: "Error: Unexpected value './[new name of the attachment omitted].pdf'" {file: "chrome://zotero/content/xpcom/file.js" line: 56}]

Kind regards,
Thomas
  • Sorry, we can't help with ZotFile here — you'd have to report this to the developer on GitHub. It looks like it's not actually creating a proper filename from the metadata, so you may want to check the format you've configured for that.
  • I have just edited the original message, replacing angle bracket with square brackets. Now the second errors is shown properly:

    "Error: Unexpected value './[new name of the attachment omitted].pdf'" {file: "chrome://zotero/content/xpcom/file.js" line: 56}
  • edited March 24, 2021
    dstillman, thank you for your reply.

    On ZotFile website, it says: "Reporting a bug - You can report bugs on the Zotfile thread in the Zotero forum." On that thread, you wrote: "OK, closing this thread. Please start new threads for ZotFile-related issues. Be sure to include ZotFile in your issue summary in the thread title." Did this policy change? Maybe ZotFile developers are not reading this forum anymore?

    I am sorry the error was not correct on my previous message. The problem is not that a filename is not been created. I have updated the message.
  • ZotFile isn’t being actively developed anymore, but if there’s any chance of getting a reply from the developer it would be on GitHub.
  • (To be clear, many people still use ZotFile, but if you run into issues you just shouldn’t expect them to be fixed anytime soon and may need to do more debugging on your end. For what it’s worth, Zotero recently introduced PDF annotation extraction, similar to (but more advanced than) what ZotFile offers, and at some point we’ll likely integrate more customizable renaming that could remove the need for ZotFile for many people.)
  • "Custom Location" is selected. The field after it is empty.
    @toliveira: If you specify a "Custom Location", the field shouldn't be empty.

    See here for a related discussion:
    https://forums.zotero.org/discussion/85032/unrecognized-path-after-renaming
  • I experience similar issues sometimes. It's frustrating because nothing indicates the operation failed and deleted your document!

    What I like about the "Rename Attachments" feature is that it can move files into a new directory structure. I would really like to see more Zotero native capability to manage/change file names and directory structure.
Sign In or Register to comment.