diegodlh / zotero-cita

Cita: a Wikidata addon for Zotero with citations metadata support
GNU General Public License v3.0
221 stars 10 forks source link

Can't fetch QIDs for all cited items if some already have QIDs #184

Closed Dominic-DallOsto closed 2 years ago

Dominic-DallOsto commented 2 years ago

I found this issue while working on #137.

To reproduce:

  1. Have an item with multiple citations, none of which have a QID
  2. Fetch the QID for just one item
  3. Now try and fetch the QIDs for all the remaining items at once (from the More... menu)

I get TypeError: qidMap is undefined here

Tracing back, this is because Wikidata.reconcile exits here, without returning anything.

The purpose of the if statement is to abort reconciliation if the item we're dealing with already has a QID, and we won't overwrite it. But when working on multiple items at once we still want to continue with all the other items.