UNRECOGNIZED_PATH after renaming

edited September 7, 2020
Report ID: D1774159184

When I rename an attachment pdf file without move it (with the ZotFile plugin), I can't anymore open or click on it. In the log view, I get an error in a zotero file (although the error append in using ZotFile).

Steps to reproduce:

1. Start Zotero.
2. Be sure that in ZotFile preferences, the filed "Custom Location" in "Location of Files" is empty.
3. Create a new entry (book or anything else).
4. Add an attachment on it with "Attach Link to File".
5. Right click on the attachment => "Manage Attachments" => "Rename Attachments"

Zotero displays the message "NS_ERROR_FILE_UNRECOGNIZED_PATH Exception: Component returned failure code: 0x80520001" and "[JavaScript Error: "Error: Unexpected value './ert.pdf'" {file: "chrome://zotero/content/xpcom/file.js" line: 56}]" in the error log if I right click on my attachment or my entry, I can't anymore select or open it.
  • What renaming pattern are you using? How are you ending up with "./ert.pdf"?
  • edited September 7, 2020
    @dstillman I use "{%t}". "ert" is the title of my entry, it's just a random name for my test.
    I specify that when I use renaming with moving (i.e. specifying a path), it works perfectly.
  • This generally can't provide support for ZotFile, but if you can provide a Debug ID for the actual renaming (not just opening), we might be able to say more.
  • @dstillman haha actually I just realized that the ID I provided is already a debug ID. I hadn't seen the error report window.
  • Right but it's not for the renaming.
  • @Milleras: If you're using ZotFile's "Custom Location" option, the custom folder should not be left empty. It sounds like this might be causing your issue.

    For a basic explanation of ZotFile's "Custom Location" setting, see here:
    https://guides.lib.berkeley.edu/zotero
    -> "ZotFile" -> "Manage & Sync PDFs with ZotFile"

    (See also here for troubleshooting related issues.)
  • @qqbb I know but I followed the instructions given here https://forums.zotero.org/discussion/comment/291003/#Comment_291003, because I want to rename my files without move them.
  • You should use stored files if you want the files to remain in Zotero's storage directory.
  • Doesn't ZotFile support just renaming for stored files, though?
  • @dstillman: Yes, by "use stored files" I meant: use ZotFile's option "Attach stored copy of file(s)" for "Location of Files". With this, ZotFile can be used for renaming stored files, without moving them out of Zotero's storage.

    @Milleras: It seems to me that ZotFile currently can't rename linked files without moving them. If you choose "Attach stored copy of file(s)", ZotFile's renaming function will convert linked files to stored files. If you select a "Custom Location", linked files will be moved to this new path.

    A solution might be to use Zotero's own renaming function for linked files that have been added outside of ZotFile. With Zotero's function "Rename File From Parent Metadata" in the context menu, attachments won't be moved. BTW, with the Zutilo add-on you can set separate keyboard shortcuts for both ZotFile's and Zotero's renaming functions. (In Zutilo's preferences, the Shortcuts table lists them as "Move and rename attachments" and "Rename attachments", respectively.) You can also configure Zotero's renaming scheme with the preference extensions.zotero.attachmentRenameFormatString in the Config Editor. Also note that you can manually rename files.

    I think it would be useful if ZotFile could offer "move only" and "rename only" functions for linked files. (The "move only" option can currently be achieved with the hidden preference extensions.zotfile.disable_renaming. However, this breaks automatic triggering of the function when adding new items.)
Sign In or Register to comment.