Zotero http links result in "page not found"
I've been developing the Notero plugin, and one of my users informed me that the Zotero http links are directing to a "page not found" error page.
For example, my plugin uses the Zotero.URI.getItemURI() function to output a link like the following:
http://zotero.org/users/8509743/items/XN4SL8R5
I thought that these links used to direct to the Zotero web library, but now I'm not sure if I'm misremembering. Did something change recently such that these links will no longer correctly direct to the web library? Is there a recommended function to use in Zotero for generating links to items in the web library?
Thanks!
For example, my plugin uses the Zotero.URI.getItemURI() function to output a link like the following:
http://zotero.org/users/8509743/items/XN4SL8R5
I thought that these links used to direct to the Zotero web library, but now I'm not sure if I'm misremembering. Did something change recently such that these links will no longer correctly direct to the web library? Is there a recommended function to use in Zotero for generating links to items in the web library?
Thanks!
getItemURI()
worked in practice, it was never guaranteed to provide a web link — that's just a URI to identify the item).The web API provides the canonical web library URL for every item in
links.alternate.href
.For the client, we'll add a function to get web library links using the username slug. For now, you can use
Zotero.Users.getCurrentUsername()
and apply the same transformation we use for the API. (There won't be a username if the person hasn't synced.)https://www.zotero.org/dvanoni/items/XN4SL8R5
and an (made up) item in your library would be
https://www.zotero.org/mlpsheldon/items/73NV7SBA instead of the
http://www.zotero.org/users/1766229/items/73NV7SBA you're currently getting
So two simple search & replace functions will work for individual users.