retorquere / zotero-better-bibtex

Make Zotero effective for us LaTeX holdouts
https://retorque.re/zotero-better-bibtex/
MIT License
5.39k stars 290 forks source link

Copy as Better BibTeX stops working after closing and reopening Zotero 7 window (macOS) #2965

Open hbuschme opened 2 months ago

hbuschme commented 2 months ago

Debug log ID

WDT57Q5R-euc/6.7.226-7

What happened?

Since updating to Zotero 7 I've had the following problem with the Better BibTeX plugin, specifically with the action "Copy as Better BibTeX". Copying, both via menu item or keyboard shortcut, works fine after starting Zotero. However, once the Zotero window (not the application) has been closed and then reopened, nothing happens when using "Copy as Better BibTeX" – the content of the clipboard does not change. To be able to use it again I have to quit and start the application.

I have updated Zotero as well as Better BibTeX (multiple times over the past weeks) and also uninstalled other plugins – to no avail.

One interesting observation from creating the debug log is that a similar issue arose. After closing and reopening the Zotero window, the Better BibTeX debug log is does not show any content and cannot be send (the debug log ID above therefore only shows a log before the window is closed).

(Zotero 7.0.3, Better BibTeX v6.7.226, macOS Sonoma 14.2.1

liuzikai commented 2 months ago

I second this. Can reproduce on my side. On first start, "Copy as Better BibTeX" works but the hotkey Cmd+Shift+C is not registered (not shown on the menu item either). After closing the window (not quit Zotero) and re-open it, the hotkey appears but the menu item is completely useless now.

It's possible that this is due to some bug in Zotero, as another plugin of mine that uses the quick copy stops working as well. But it would be great if this could be fixed soon. It's very annoying having to re-launch Zotero every time to use BBT.

retorquere commented 2 months ago

I will look at the reopen problem, but BBT does nothing with hotkeys. That's either Zotero, Zutilo, or Zotero Action & Tags.

hbuschme commented 2 months ago

The keyboard shortcut works for me (after start, before window closing) and is also shown in the menu bar:

Screenshot 2024-08-29 at 16 55 45
retorquere commented 2 months ago

That's just the generic quick-copy shortcut, where BBT is the chosen quick-export format. If that doesn't work, that's a Zotero problem.

hbuschme commented 2 months ago

OK, do I have a misconception of how to use the plugin then? This is my default way of using it, hand picking the citations I need and then pasting them into the .bib file in my editor or Overleaf project. Or is there another way to export individual Zotero entries via Better BibTeX that I do not know about?

I have now tried another quick copy format, and there the quick copy menu item and shortcut do not stop working after closing and reopening the Zotero window. Maybe the problem is at the interface between program and plugin?

retorquere commented 2 months ago

No the problem is definitely in BBT, and you're using it right, but BBT doesn't know how it's called, whether as a quick copy or as a manual export. I suspect the issue will resolve when I fix the BBT problem. I'm just saying - I don't do anything with/for shortcuts, that's zotero functionality.

MrSerth commented 2 months ago

While debugging #2948, we identified an issue logged as TypeError: window is null. To ease resolution of this one, here are some additional information:

Reproduction steps:

  1. Open Zotero
  2. As soon as the main Zotero window is visible and showing the "Loading items" text in the center of the publication list, close the window with cmd + W
  3. The alert TypeError: window is null is shown.

I know that this "workflow" of starting and immediately closing Zotero is not expected and probably not supported either. While there are other occasions when the bug is triggered, this one seems the easiest to reproduce it.

Debug log:

VNTMFGB3-euc/6.7.234-7
hbuschme commented 1 month ago

I can confirm that the issue has been resolved. Thanks a lot!

retorquere commented 1 month ago

It is expected on MacOS and Zotero explicitly wants plugins to support it. I am going to fix this, just a lot on my plate right now.