chrisgrieser / alfred-bibtex-citation-picker

Citation picker & lightweight reference manager for BibTeX files, via Alfred.
MIT License
143 stars 8 forks source link

[Bug]: The workflow does not find references #48

Closed axbax closed 5 months ago

axbax commented 5 months ago

Bug Description

When loading the workflow in Alfred with the 'ct' keyword and entering author name, nothing comes up.

Relevant Screenshot

Screenshot 2024-04-15 at 09 13 06

To Reproduce

Double press control. In the Alfred command, write Biesta. Nothing comes up.

Debugging Log

[08:58:01.299] Supercharged Citation Picker[Hotkey] Processing complete
[08:58:01.315] Supercharged Citation Picker[Hotkey] Passing output '' to Script Filter
[08:58:01.322] Supercharged Citation Picker[Script Filter] Queuing argument '(null)'
[08:58:01.406] Supercharged Citation Picker[Script Filter] Script with argv '(null)' finished
[08:58:56.731] Logging Started...
[09:00:15.270] Supercharged Citation Picker[Hotkey] Processing complete
[09:00:15.278] Supercharged Citation Picker[Hotkey] Passing output '' to Script Filter
[09:00:15.289] Supercharged Citation Picker[Script Filter] Queuing argument '(null)'
[09:00:16.076] Supercharged Citation Picker[Script Filter] Script with argv '(null)' finished
[09:00:16.083] STDERR: Supercharged Citation Picker[Script Filter] ./scripts/write-citation-picker-buffer.js: execution error: Error: TypeError: undefined is not an object (evaluating 'firstLine.split("{")[1].trim') (-2700)
[09:00:50.618] Supercharged Citation Picker[Hotkey] Processing complete
[09:00:50.628] Supercharged Citation Picker[Hotkey] Passing output '' to Script Filter
[09:00:50.640] Supercharged Citation Picker[Script Filter] Queuing argument '(null)'
[09:00:50.666] Supercharged Citation Picker[Script Filter] Script with argv '(null)' finished
[09:02:08.221] Supercharged Citation Picker[Hotkey] Processing complete
[09:02:08.225] Supercharged Citation Picker[Hotkey] Passing output '' to Script Filter
[09:02:08.242] Supercharged Citation Picker[Script Filter] Queuing argument '(null)'
[09:02:08.694] Supercharged Citation Picker[Script Filter] Script with argv '(null)' finished
[09:02:08.702] STDERR: Supercharged Citation Picker[Script Filter] ./scripts/write-citation-picker-buffer.js: execution error: Error: TypeError: undefined is not an object (evaluating 'firstLine.split("{")[1].trim') (-2700)

Sample BibTeX Entries

@book{Biesta2003,
  title = {Pragmatism and Educational Research},
  author = {Biesta, G. and Burbules, N. C.},
  year = {2003},
  publisher = {Rowman \& Littlefield Publishers, Inc.},
  address = {Lanham},
  keywords = {Education,MA430,Pragmatics,Vurdering},
  file = {/Users/kennethaggerholm/Zotero/storage/8UV9NR6Y/Biesta & Burbules 2003 Pragmatism and educational research.pdf}
}

@book{Biesta2006,
  title = {Beyond {{Learning}}. {{Democratic Education}} for a {{Human Future}}},
  author = {Biesta, G.},
  year = {2006},
  publisher = {Routledge},
  address = {New York},
  keywords = {Critical Pedagogy,Education,Learning,Pedagogy},
  file = {/Users/kennethaggerholm/Zotero/storage/WJETURI8/Biesta 2006 Beyond Learning. Democratic Education for a Human Future.pdf}
}
fHis account of natality draws on (Arendt, 1961).},
  file = {/Users/kennethaggerholm/Zotero/storage/UH9EXTNV/Biesta 2022 World-Centred Education. A View for the Present.pdf}
}

@article{Biesta2022a,
  title = {Who Educates the Teacher Educator? {{On}} Research, Practice, and Politics},
  author = {Biesta, Gert and Takayama, Keita and Kettle, Margaret and Heimans, Stephen},
  year = {2022},
  journal = {Asia-Pacific Journal of Teacher Education},
  volume = {50},
  number = {4},
  pages = {325--327},
  doi = {10.1080/1359866x.2022.2104467},
  note = {The following values have no corresponding Zotero field:\\
publisher: Informa UK Limited},
  file = {/Users/kennethaggerholm/Zotero/storage/BMNK4DYN/Biesta et al. 2022 Who educates the teacher educator On research, practice, and politics.pdf}
}

Buffer Files

buffer.json last_version.txt

Workflow Configuration

Screenshot 2024-04-15 at 09 10 03

Checklist

chrisgrieser commented 5 months ago

Thanks! So it looks like the issue that the new Zotero Beta results in a bibtex file with partially invalid entries. (The sample entries you shared are okay though).

I have modified the parser to not throw an error when such a problem occurs, so there should not be an error anymore in the new version: https://github.com/chrisgrieser/alfred-bibtex-citation-picker/releases/download/11.15.0/alfred-bibtex-citation-picker.alfredworkflow


However, the invalid entry/entries will be skipped, so will not show up in the citation picker – you might want to check your BibTeX file for those entries. In your .bib file, there is some line that starts with a @, but does not have the form @category{citekey,, which was what caused the error. Those lines must be fixed to be included in the citation picker.

You can also share the invalid here, in case there is something weird going on there, I could have a look

axbax commented 5 months ago

Thank you so much. That did the trick! I rely heavily on this wonderful workflow to navigate my Zotero references, so your help is much appreciated!

chrisgrieser commented 5 months ago

Thanks, you're welcome :)