bwiernik / zotero-shortdoi

Zotero extension to retrieve and validate DOIs and shortDOIs
Mozilla Public License 2.0
1.29k stars 49 forks source link

Zotero 7 #42

Closed thebluepotato closed 1 month ago

thebluepotato commented 5 months ago

This PR brings support for DOI Manager to Zotero 7, related to #41.

This should be considered very much WIP.

Current features:

~Lots of debugging required, but seems to work both in Zotero 6 and 7.~

Note that the core logic of fetching/checking DOIs is unchanged. The aim here is to get a version working with Zotero 7, with the same underlying logic.

bwiernik commented 5 months ago

Awesome thank you! I will take a look. Please feel free to keep adding to this PR

thebluepotato commented 5 months ago

Preferences window is up and running, now part of the Zotero preferences instead of its own window. Now using Fluent for that preference pane. Since the tools and item menus are now generated via code instead of overlays (for Zotero 6 & 7), certain obsolete language files were deleted.

thebluepotato commented 4 months ago

I guess the updating mechanism should work? Z6 will install based on install.rdf which now points to updates.json for updates, just like Z7's manifest.json. Add-on is no longer compatible with Z5 because I'm pretty sure Zotero's new system is not meant to be compatible with 3 major versions simultaneously...

LionSR commented 4 months ago

curious to know if this is ready to go?

thebluepotato commented 3 months ago

curious to know if this is ready to go?

The code has been ready for a while now, and the update mechanism should work (no real way to test it). I'm just waiting for @bwiernik to merge the PR

citadel-lewis commented 2 months ago

@thebluepotato is it possible just to create a fork of this project using your code? It's been 2 months waiting for this to be merged.

thebluepotato commented 2 months ago

@thebluepotato is it possible just to create a fork of this project using your code? It's been 2 months waiting for this to be merged.

You can use the fork this PR is based on. I haven't tested the "script" that packages the code into XPI but it should be trivial (zip the files and rename the extension).

citadel-lewis commented 2 months ago

@thebluepotato is it possible just to create a fork of this project using your code? It's been 2 months waiting for this to be merged.

You can use the fork this PR is based on. I haven't tested the "script" that packages the code into XPI but it should be trivial (zip the files and rename the extension).

Alright, I'll try this tomorrow. Thanks!

pkej commented 2 months ago

Change extension from ".zip" to ".xpi". zotero-doi-manager-1.5.0.zip

citadel-lewis commented 2 months ago

Change extension from ".zip" to ".xpi". zotero-doi-manager-1.5.0.zip

That installs okay but when trying to select DOI Manager tab in the settings it doesn't load the tab to see the settings ... not sure if it's working or not

thebluepotato commented 2 months ago

I just pushed some changes that should fix the missing prefpane. I had moved it to another folder without updating the link in code. For some reason, one of the checks made when updating DOIs (namely that the current item is not a collection) threw an error so I also removed it since if the item is a "regular item" it cannot be a collection (from the sidebar) at the same time. Please feel free to test and report back!

mjthoraval commented 2 months ago

This is working great for me. Thank you very much! The emoji tags are now displayed in the Items Tree in the latest beta beta version: https://github.com/zotero/zotero/commit/26f7c707bae46534d19be08907f54b2f3c798ed8

mjthoraval commented 2 months ago

The plugin does not seem to work on newly added items. For example, importing this article does not find a DOI, but the plugin does not add the "No DOI found" tag: https://www.jkps.or.kr/journal/view.html?spage=1335&volume=49&number=4

Here are the options I have set:

image

thebluepotato commented 2 months ago

@mjthoraval Should be fixed now. This was actually buggy in the Zotero 6 version, I guess.

mjthoraval commented 2 months ago

Problem fixed, thank you.

SR-- commented 1 month ago

Is the binary above the one with the latest fix, please?

thebluepotato commented 1 month ago

Is the binary above the one with the latest fix, please?

I guess you're referring to this comment. There you go for the latest version: zotero-doi-manager-1.5.0.zip. You should download the zip file and then rename it to xpi.

thebluepotato commented 1 month ago

@bwiernik Any ETA on merging this PR? As noted above, people have begun using it. Dunno whether the update mechanism works, but only one way to find out.

SR-- commented 1 month ago

Is the binary above the one with the latest fix, please?

I guess you're referring to this comment. There you go for the latest version: zotero-doi-manager-1.5.0.zip. You should download the zip file and then rename it to xpi.

Thanks. Does not work for me. Installs but fails to update a long DOI into a short one.

Shows this window but never completes.

image

thebluepotato commented 1 month ago

If you want me to debug it I'll need the logs and the item you're trying to update

SR-- commented 1 month ago

Not item-specific. None works. Is this relevant? image

thebluepotato commented 1 month ago

Not item-specific. None works. Is this relevant? image

Are you sure you're using the ZIP file from my comment, and not @pkej's? The isCollection lines have all been removed. I've checked with my test entries and have been able to switch back and forth between long and short DOIs.

bwiernik commented 1 month ago

Thanks @thebluepotato

SR-- commented 1 month ago

@thebluepotato

I have installed the released version now, but the result is the same. The process does not complete, and I am seeing the same error.

I am so confused because the file I download has no such lines but the one in Zotero profile has this:

image

Actually, I see that the released ZIP does not have such lines but XPI does...

thebluepotato commented 1 month ago

@SR-- that's odd indeed 😅 The new release script that was merged will definitely help. Trying to automate this even more with GitHub Actions but I'm really unfamiliar with them. Anyway, you can actually take the "released ZIP" and rename it to XPI and you're good to go. There's a few extra files in there but you should be fine.

@bwiernik I think you made the XPI on the basis of a stale local copy of the repo. Using the release.sh will guarantee that you've pulled the latest commit for now, but I'll still try to suggest a GitHub action so in the future you just have to click release or something.

SR-- commented 1 month ago

@thebluepotato Thank for looking into this. I have tried renaming the ZIP already actually, but Zotero rejected it.

mjthoraval commented 1 month ago

I am using the latest files in this fork, identified as version 1.5.1. The tag "â›” No DOI found" is correctly applied when importing the article from the page I had reported above: https://www.jkps.or.kr/journal/view.html?spage=1335&volume=49&number=4 But it does not work for this page, which also does not have any DOI: https://caves.org/journal-of-cave-and-karst-studies/jcks-articles/variable-calcite-deposition-rates-as-proxy-for-paleo-precipitation-determination-as-derived-from-speleothems-in-central-florida-u-s-a/

After adding the item in my library, the manual check "Verify and clean DOIs" also does not work. The Debug Output shows: (3)(+0000002): Zotero DOI Manager: CrossRef lookup: Unknown status code: malformed

Tested on: Zotero 7.0.0-beta.117+794dc6bf0 (64-bit) Windows 10

thebluepotato commented 1 month ago

I am using the latest files in this fork, identified as version 1.5.1. The tag "â›” No DOI found" is correctly applied when importing the article from the page I had reported above: https://www.jkps.or.kr/journal/view.html?spage=1335&volume=49&number=4 But it does not work for this page, which also does not have any DOI: https://caves.org/journal-of-cave-and-karst-studies/jcks-articles/variable-calcite-deposition-rates-as-proxy-for-paleo-precipitation-determination-as-derived-from-speleothems-in-central-florida-u-s-a/

After adding the item in my library, the manual check "Verify and clean DOIs" also does not work. The Debug Output shows: (3)(+0000002): Zotero DOI Manager: CrossRef lookup: Unknown status code: malformed

Tested on: Zotero 7.0.0-beta.117+794dc6bf0 (64-bit) Windows 10

The CrossRef lookup needs an author or a page to check DOIs. The translator imports the article you mentioned into the library without either, so the plugin fails instead of tagging the item with "No DOI".

SR-- commented 1 month ago

@thebluepotato

Anyway, you can actually take the "released ZIP" and rename it to XPI and you're good to go. There's a few extra files in there but you should be fine.

Tried again, does not work. What am I missing?

thebluepotato commented 1 month ago

@thebluepotato

Anyway, you can actually take the "released ZIP" and rename it to XPI and you're good to go. There's a few extra files in there but you should be fine.

Tried again, does not work. What am I missing?

Can you describe the steps you're taking? What do you mean "rejects", any error message?

SR-- commented 1 month ago

@thebluepotato

Thanks!

Steps: Download ZIP for the release. Remove the files that are not in XPI. Rename into XPI. Try to add as a plugin.

Here is the error:

image

And this is the file that I use: https://we.tl/t-UByOVehq5V

Of course the best would be to fix the release...

mjthoraval commented 1 month ago

@SR-- Which version of Zotero are you using?

mjthoraval commented 1 month ago

@SR-- The file you have shared contains a folder: image

It should contain the files and folders directly: image

SR-- commented 1 month ago

Which version of Zotero are you using?

7.0.1, and, yes, it works once I remove the folder, silly me. Thanks @mjthoraval