[Bug] "Rename file from parent metadata" not working for attached pdfs

Hi, congrats for the new look & feel. Looks great and loving the the new, albeit not massive changed, UX. Also the new epub and annotation capabilities in the documents seem promising.

Just to note that the file renaming function has stopped working as of version 7. It worked ok on the previous one, but since the update even if I right click and order it the file doesn't change and keeps as "PDF" in capital letters. I attach an example:

https://s3.amazonaws.com/zotero.org/images/forums/u10294532/ce28yzmiygu3jh5a9gok.png

As the system doesn't produce any error per se, I can't report an error code through the system.

Thanks

System specs:
Ubuntu 20.04 LTS
Intel Core i7-8565U
RAM 16Gb
Intel UHD graphics 620
Kernel 6.8.0-40-generic
64 bits
Zotero: 7.0
  • https://www.zotero.org/support/file_renaming#attachment_title_vs_filename

    Files were always being automatically renamed - you never needed to manually right-click and Rename File from Parent Metadata unless you changed the parent item. A bug in previous versions of Zotero caused the attachment title, which is different from the filename, to be changed as well; that's fixed in Zotero 7.
  • Thanks for the reply. Then the feature isn't working. Zotero 7 is not renaming files automatically nor manually:

    https://s3.amazonaws.com/zotero.org/images/forums/u10294532/38pji7n78ofcnsiz0b76.png

    They stay like this
  • Update. In the process of right clicking and requesting for the 'Rename...' I saw the message poping in the bottom right corner indicating it had done as requested. Wondering, I decided to check the actual naming on the pdf in the file and voilá:

    https://s3.amazonaws.com/zotero.org/images/forums/u10294532/4uhfkmi63sf4mt76waza.png

    Zotero is changing the name of the file, but not displaying it correctly as the image shows.

    Thanks for the amazing work.
  • It’s working correctly. Read the linked page.
  • I am having the same problem with unexpected attachment titles.

    I don't understand what the benefit of attachment titles not being the filename. Or at least, it should be an option that they are.

    I actually new that the automatic file renaming was working in previous versions. The reason why I still clicked on "Rename File from Parent Metadata" was precisely because it gave me a nicer title. That option seems to be gone now as well.

    As for the provided link, if I understand it correctly, one would have to run the JavaScript every time a new attachment is added. So, that doesn't seem like a reasonable solution either.
  • I don't understand what the benefit of attachment titles not being the filename.
    The benefits are explained on the linked page.
    if I understand it correctly, one would have to run the JavaScript every time a new attachment is added
    No, the JavaScript updates existing attachments with titles matching the filename to use the simpler titles.
  • Thanks for your quick reply.

    I have read the linked page again. I did not find it easy to understand. But if I understand it correctly the benefit is:

    "These separate titles avoid cluttering the items list with duplicate metadata and prevent parent items from being unnecessarily expanded when searching for titles or creators."

    However, the feature was different previously. I know the page says that this was a bug. But there seems to be no way to fix the PDFs that have been added previously in Zotero.

    The page also states:

    "Subsequent files added to an item from the filesystem will still get titles named after the filename (without the file extension), since those are likely to be supplementary files and the filename may be informative."

    But this seems highly confusing because previously files names this way were exactly not supplementary but the major attachment.

    Finally, maybe reword at least the instruction on how to rename:

    "You can view and change the title and filename by clicking on the attachment and looking in the item pane."

    I guess there is nothing renamed by clicking and looking. Instead, one has to also click on the title or filename in the item pane. Maybe that is obvious but it wasn't for me.

    Anyway, thanks for all the work on Zotero! I am sure most of it has been improved in version 7 due to it.
  • edited August 19, 2024
    I know the page says that this was a bug. But there seems to be no way to fix the PDFs that have been added previously in Zotero.
    That's exactly what the code in the linked section does. It will change titles named after the filename to simpler, less-distracting, less-redundant titles like "PDF", in line with current behavior. (We'll be moving that code to a menu option in an upcoming update.)
  • Ok. Got it. I'll just get used to this no problem. Thanks!
  • Sorry for being slow but it is still a bit confusing to me.

    I am still a little afraid to run the script. For example, I have many books where I meticulously named attached PDFs such that they correspond to chapter titles (but also include the book title since that seemed to be the previous default). I find that very helpful in order to distinguish them. The description of the script sounds as if it will rename all my files. So, probably I should not run the script, right?

    Also, what is the important difference between dragging a file and importing it via the browser that justifies different ways in which the attachments are named?
  • @daniel.r: As written, it will only re-title attachments where the title ends in ".pdf".
    Also, what is the important difference between dragging a file and importing it via the browser that justifies different ways in which the attachments are named?
    When you save from the web, Zotero knows what's being saved, so it can provide more context for what the file is — conveying, say, that this is the canonical PDF from the publisher, or that this is a submitted (but not officially published) open-access copy.

    When you drag a file from the filesystem, all we have is the filename.

    But Zotero 7 uses "PDF" for the latter case to bring it closer to the simpler, less-redundant titles of attachments saved from the web.
  • Okay, thanks for clarifying. Then I should really not use the script. Since what I did was use the title that Zotero (<7) automatically suggested, i.e. with ".pdf", and add the name of the chapter to it.
  • edited August 20, 2024
    Note that the cleaner way to do this in Zotero 7 would be to use just chapter titles for the attachment titles (as Zotero should generally do automatically if you save them from the web on a supported site) and then configure a custom filename format that conditionally used the attachmentTitle variable for secondary files (e.g., files that weren't just "PDF"), which could incorporate the book metadata.

    This will particularly pay off once we add continuous renaming to keep filenames in sync as metadata is edited, which we're hoping to do soon.
  • I see.

    Here is another thing that I was confused about. The page states:

    "These separate titles avoid cluttering the items list with duplicate metadata and prevent parent items from being unnecessarily expanded when searching for titles or creators."

    First, I couldn't reproduce the problem about unnecessarily expanded items. But this was because I used the "Title, Creator, Year" entry from the quick search menu. Only now, I realized that when searching for "Title" (I still cannot reproduce with "Creator") using the "Advanced Search" that it shows attachments. It seems a little strange that there is this difference...
  • edited August 20, 2024
    "Title, Creator, Year" specifically searches only parent items.

    "All Fields & Tags" and the advanced-search conditions will match any item, so that's where you'll see this problem.
  • edited August 31, 2024
    I actually thought the "bug" was the way Zotero was meant to work, and attachments not being renamed *was* the bug. This has several benefits:

    1. It's reasonable to assume that the representation of an object (the table entry) would reflect the object itself (the file on disk). If a user has to remember that the representation isn't faithful to the object (and they have to refer to the documentation for that...), then it adds to their cognitive load and makes the app less intuitive.
    2. It's also reasonable to assume that the text appearing in the "title" column is the entry's title. Having it contain the entry's type instead is confusing and somewhat redundant, given that that information is already contained in the entry's icon. That said, if a textual description is still needed, it would make more sense to have it in the "item type" column ("Attachment: PDF").
    3. If a representation is faithful to the object, then the user can more easily interact with it or verify its state. For example, there's no need for a pop-up to let you know that a file was renamed - which is a distraction - if you can directly observe it.

    Searching shouldn't be an issue with a simple checkbox like "include attachments", or a button to automatically expand or collapse entries.
  • Hi @dstillman and everyone,

    I guess we all know the usually humoristic proverb "it's not a bug, it's a feature", but in this case (and probably also given the fact that a lot of people got used to it) it seems that the bug (well i thought it was a useful fetaure but apparently i just learned in this topic that it was a bug) of attachment renaming was a feature that some people liked.

    I include myself in the bug-feature liking persons, i have found that it is very often a pretty useful feature to show the attachment name in the same renamed way that the filename.

    In particular when you are searching in a big biblio base with lots of papers talking about more or less the same stuff, it's a very useful way to instantly narrow your quick search : if you know that you are looking for a paper for which you know the name of the first author and/or one or two words from the beginning of the title, then it's immediately useful : among 100 parent items that are shown for your quick search (because the author was second or third or tenth author, or because the keyword that you typed in in the name of the journal or is in the abstract, or that kind of stuff), your eye just go directly to the 2 or 3 items that are expanded (and thus showing a second line with a different aspect, red icon, etc : very visible), and BAM! You're done.
    I've gained some nice time (and confort of use) on countless occasions with that type of behaviour from Zotero 6.

    ..and so i am very sad to see that this is disappearing from the new Zotero version.


    Could the development team find a way to, like, add a tickable option that would say :
    "[TICK] Use the filename as the Attachment Title"

    That would be very nice for all of us bug-liking persons, thanks a lot!

    And anyway thanks @dstillman and the development team for the nice work!
Sign In or Register to comment.