retorquere / zotero-better-bibtex

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

itemID not present on foreground exports #1420

Closed ermsdev closed 4 years ago

ermsdev commented 4 years ago

Report ID: 3LD6BNJN-euc

Exporter used: Better BibTeX, Better BibLaTeX

Expected behavior: Select items from Zotero, export to a .bib file using the Better BibTeX formats with no translator options selected.

Actual behavior: Select items, click export, select the Better BibTeX format, click ok, click save in file dialog, Zotero briefly loads and then an error appears, "An error occurred while trying to export the selected file." A .bib file does get created with only one item in it, regardless of how many were selected to be exported.

I'm new to BibTex, and the default BibTex export format provided by Zotero kept preventing my document from compiling. The individual items that Better BibTex does export do appear to work in my document.

I'll try downgrading to an older version of Better BibTex later to see if it's a recent issue.

Exported file with the Better BibTex format:


@article{dey,
  title = {Improved {{Image Classification}} Using {{Topological Persistence}}},
  author = {Dey, Tamal and Mandal, Sayan and Varcho, William},
  year = {2017},
  pages = {8},
  abstract = {Image classification has been a topic of interest for many years. With the advent of Deep Learning, impressive progress has been made on the task, resulting in quite accurate classification. Our work focuses on improving modern image classification techniques by considering topological features as well. We show that incorporating this information allows our models to improve the accuracy, precision and recall on test data, thus providing evidence that topological signatures can be leveraged for enhancing some of the state-of-the art applications in computer vision.},
  file = {/Users/stephen/Documents/zotfiles/Dey et al_2017_Improved Image Classification using Topological Persistence.pdf},
  keywords = {Read,Use},
  language = {en}
}

Exported file with the BibTex format:


@article{yang,
    title = {Image classification using topological features automatically extracted from graph representation of images},
    url = {http://www.mlgworkshop.org/2019/papers/MLG2019_paper_7.pdf},
    abstract = {The performance of machine learning methods is strongly depen- dent on the data representation (features) to which they are applied. For drawings in particular, we cannot rely on texture, color or shad- ing information; there is little information present in a drawing beyond the spatial relationships and topology. A topological graph is an intuitive and powerful data structure and data representation framework that can capture the topological relations and spatial arrangement among entities present in images. In this paper, we use topological features automatically extracted from graph represen- tations of images for image classification. Our approach is simple, intuitive, and generic. We compare our method against a traditional feature descriptor, histogram of oriented gradients (HOG) on the MNIST data set. The results demonstrate the effectiveness of our graph approach, especially when applied to small sets of training data. In addition, our method is very fast to train, and also much less sensitive to hyperparameters, requiring little hyperparameter fine tuning.},
    author = {{Yang} and Oyen, et al.},
    year = {2019},
    keywords = {computer vision, graph theory, image analysis, image classification, topological analysis, machine learning, Consider, Proposal Bibliography},
    file = {Yang_Oyen_2019_Image classification using topological features automatically extracted from.pdf:/Users/stephen/Documents/zotfiles/Yang_Oyen_2019_Image classification using topological features automatically extracted from.pdf:application/pdf}
}

@article{dey,
    title = {Improved {Image} {Classification} using {Topological} {Persistence}},
    url = {http://web.cse.ohio-state.edu/~dey.8/paper/ImagePers/ImagePers.pdf},
    abstract = {Image classification has been a topic of interest for many years. With the advent of Deep Learning, impressive progress has been made on the task, resulting in quite accurate classification. Our work focuses on improving modern image classification techniques by considering topological features as well. We show that incorporating this information allows our models to improve the accuracy, precision and recall on test data, thus providing evidence that topological signatures can be leveraged for enhancing some of the state-of-the art applications in computer vision.},
    language = {en},
    author = {Dey, Tamal and Mandal, Sayan and Varcho, William},
    year = {2017},
    keywords = {Read, Use},
    pages = {8},
    file = {Dey et al_2017_Improved Image Classification using Topological Persistence.pdf:/Users/stephen/Documents/zotfiles/Dey et al_2017_Improved Image Classification using Topological Persistence.pdf:application/pdf}
}
ermsdev commented 4 years ago

5.2.11 doesn't show the error in Zotero.

(unescaped underscores in URLs seem to cause a problem when compiling my document, that would be a separate issue that I'm guessing is already fixed in 5.2.13 since there was no issue compiling with .bib files exported by 5.2.13; I'd have to uninstall/reinstall again to make sure)

sharulhafiz commented 4 years ago

I'm having the same issue.

retorquere commented 4 years ago

@stephenermshar the URL issue could be the same as #1305; it is in any case not related to the problem you're seeing here. The log gives me some leads.

@sharulhafiz "an error occurred" is just how Zotero reports all errors in translators. Without a debug log it is not possible to say whether you have the same issue. A log would be most appreciated.

retorquere commented 4 years ago

@stephenermshar I have your error reproducible, shouldn't be hard to fix.

blip-bloop commented 4 years ago

:robot: this is your friendly neighborhood build bot announcing test build 5.2.13.5803 ("enrich for foreground exports, fixes #1420")

Install in Zotero by downloading test build 5.2.13.5803, opening the Zotero "Tools" menu, selecting "Add-ons", open the gear menu in the top right, and select "Install Add-on From File...".

retorquere commented 4 years ago

@stephenermshar can you try 5803?

retorquere commented 4 years ago

@stephenermshar I see you have background exports turned off. Did you experience problems with them?

ermsdev commented 4 years ago

I updated to 5.2.14 since I see you added that version after I opened this issue. There are no issues with exporting now.

As far as I know I didn't do anything to disable background exports. This may be unrelated, but I tried setting extensions.zotero.translators.better-bibtex.workers to 0 (as mentioned in #1396) before opening an issue, even though it looked like it was already set to 0.

If background exports are the same as selecting the keep updated option on export, I just hadn't gotten to try that yet, but I have now and it works well.

Thanks! 🎉🎉🎉

retorquere commented 4 years ago

Yeah I could replicate the problem and fixed it. I thought it severe enough that I wanted to publish the fix immediately, but thanks for the confirmation.

Setting workers to 0 means no background exports (which is not the same as auto exports - I'll need to document that clearer).

I'd recommend keeping workers at the default 1 unless you're experiencing problems and we're investigating them. In this case I benefitted from you having it at 0 because that brought this bug to light.

retorquere commented 4 years ago

oh and the slider in the advanced pane for background exports just sets the workers value - the slider allows you to set workers between 0 (disabled) and 10 (really only useful if you have many auto exports set up)

ermsdev commented 4 years ago

I'm glad it helped reveal the issue! I'll set that back to 1 then, thanks again.

retorquere commented 4 years ago

Oh in #1396 I recommended to set workers to 0 as a temporary workaround, it's not meant as a fix. I mean for background exports to be the default. It's already much more performant than regular exports ever were.

retorquere commented 4 years ago

My pleasure. I have added a test case for this so it can't happen again.

github-actions[bot] commented 3 years ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.