[5.0 Beta] Links are being deleted in notes

edited January 26, 2017
I just upgraded to Zotero 5.0. I noticed that the zotfile 'open-pdf' links no longer work. However, as I was investigating the cause and a possible solution, I noticed that my notes containing these zotfile links were being altered; the links were deleted. The visible text would remain in the note, but the blue & underlined styling was removed. I looked at the underlying code and found the href attribute was deleted.

For example, the code went from:
a> href="zotero://select/ite...">zotero://sele ... /a>
to
a>zotero://select/ite.../a>

(html brackets broken to prevent link creation in above examples; ellipses added to shorten)

I enabled the debug console and captured as the links were destroyed. I included two links in the note: one to http://zotero.org and one using zotero://select ...

Here is a link to the full the debugging output:
https://gist.github.com/mtd91429/970cede8bbfdd6e639f2fec204927845

It seems that the links are being stripped of their href element sometime in here:
https://gist.github.com/mtd91429/970cede8bbfdd6e639f2fec204927845#file-zotero_debug_vanishinglinks-txt-L211-L287

Is this intentional behavior that won't be changing? Or is it a bug?
  • I haven't found where in the code the href removal occurs. However, I do think that it is related to to syncing with the server. I installed the master branch of zotero in an unsigned nightly build version of firefox and didn't sign in. The sync process cannot occur because of this (obviously). Under this circumstance, the zotero link was never deleted.

    I know that doesn't narrow it down a lot; but it eliminates the tinymce plugin as the culprit.
  • I get the same problem : zotfile direct links (link) are removed on sync.

    I also want be able to add these "zotero://open-pdf/" links manually (via the TinyMce link menu and by pasting HTML clipboard) : both are possible, but the links also get removed on sync.

    I have noticed that if I create a zotero://open-pdf/0_xxx link manually via the TinyMce menu and then click on the link before the sync, then the sync doesn’t remove the link until the next change in the note : once I modified the note by adding another link or simply taping a letter, then the link is removed on the next sync.
  • See this github issue for for further details
    https://github.com/zotero/zotero/issues/1163

    As @dstillman said, it is a server side issue. I think it involves HTMLPurifier
    https://github.com/zotero/dataserver/issues/35

    While not ideal, I've stopped syncing my library to prevent this from happening.
  • Same problem here. I need to sync my library, hopefully it will get resolved, but not a deal breaker for me.
  • So, I'd make sure you have a backup before trying, but this should be resolved. For what it's worth, I believe this was actually happening with 4.0 too, but the 4.0 sync process didn't update the local note with the cleaned version of the note from the server, as 5.0 does. If you synced those notes to another computer, however, I believe the zotero:// links would have been missing.
Sign In or Register to comment.