Removing broken attachments
dstillman
Zotero Team
This discussion was created from comments split from: PDF icon on link attachments (possible bug?).
This is an old discussion that has not been active in a long time. Before commenting here, you should strongly consider starting a new discussion instead. If you think the content of this discussion is still relevant, you can link to it from your new discussion.
Upgrade Storage
I believe these links could be remaints of my former Mendeleydesktop installations (I ex-/imported the whole databases in March 2019). They are dead links and I cannot find any way to get rid of them.
Does anybody know how to get rid of theses?
In any case, I'm not totally sure what your question is. You can delete an attachment the same way you can delete any other item — by selecting it in the middle pane and pressing Delete on your keyboard.
If you're asking how to delete them in bulk, if you can construct a search that matches only those attachments, either in the search bar or with a saved search, you can use Select All to select just the matching items and delete them that way.
(1) I have pdf attachments with an icon in red for the pdf reader software; on the right-hand side the file name, number of pages, date of the last change to the file, status of indexing, related entries and Tags are shown.
(2) I also have also pdf attachments with a bluish icon (with a camera?); on the right-hand side above the file name a dead link in blue is given (I suspect from my former mendeley installation), number of pages are not indicated, date of the last change to the file is given, status of indexing is fixed to "no", related entries and Tags are shown. The file cannot be indexed.
So my question is, is there some way to fix?
Or need I manually delete this file and try to readd it and see if it is fixed? Problem I believe I have quite a big bunch of such files.
If there's no chain icon on the attachment icon, these are stored files, and they should exist on the computer where you originally added them to Zotero. Whether they came from Mendeley shouldn't be relevant — Zotero shouldn't have imported missing files. If you added them on another computer, you likely just haven't synced those files and should see Files Not Syncing.
I just deleted one of these pdf files of the category (2) I described above and then reattached the identical file. Now everything looks normal as described in category (1). The number of pages is given, the file can be indexed and certainly there is none of these dead links, which I suspected coming from mendeley import. You could see it as a visual flaw, but I didn't like it. So I will treat these attachments manually in the future.
Thanks again!!
Clicking on this snapshot icon also opened a pdf residing on my computer in the Zotero/storage directory. Do not know how this happened but I have several of such entries...
You could inspect the attachment item properties with Zotero's JavaScript API. Select an attachment and run:
var items = Zotero.getActiveZoteroPane().getSelectedItems(); items;.Stored files show
"linkMode": "imported_file", snapshots show"linkMode": "imported_url".Perhaps there is a way to correct the attachments through a script, but I don't know if there's a good way to do this properly. One could search for snapshots with
"filename": "*.pdf". Besides the "linkMode", some other fields might need to be corrected as well.@grimmomueller: Could you specify your dead links further? When importing through Zotero's browser connector, PDF attachments are saved with links to their original URL. Other types of links should probably be saved as separate attachments when importing from Mendeley. I don't know whether one can assume anything about links that Mendeley exports together with a PDF file.
It sounds like one issue here is just that some/all of those PDFs weren't assigned the PDF content type, which is why they're showing the camera icon instead of the PDF icon. I can look into that. A future version of Zotero will also fix those automatically when they're opened.
I'm not clear if there are other problems, but there's no point trying to debug those if @grimmomueller doesn't want to.
I will not try to get a hold of any script for fixing this issue. When I stumble over such an affected reference with attached pdf, I will probably fix it by re-attaching the pdf which already worked once as described above.
@qqbb : The dead links can be any links in my opinion, sometimes they are ones to websites, sometimes they seem to be old paths (linux and windows) of one of my past computers...
I believe the only affected items are roughly 180 entries which contained pdfs with annotations from within mendeley. I remember I had to treat them according to special import advice (but it forgot details; I also had to revert my encrypted mendeley database for versions >18)
@dstillman : If this could be automatically fixed in some future versions, sounds great. But for now I can handle it with my workaround of re-attaching.
Thanks again and a better new year.