zotero / translation-server

A Node.js-based server to run Zotero translators
Other
123 stars 52 forks source link

Item comparison when selecting from multiple items in /web broken #105

Closed larsgw closed 5 years ago

larsgw commented 5 years ago

This line compares selected items to the items from the original session:

https://github.com/zotero/translation-server/blob/2dfd9dcb19ab45323a23eb88277a64c48e99ecd4/src/webSession.js#L349

The comparison above does not work if this.items[i] is an object, since the two can never be the exact same instances. Although Zotero seems to specify that items in the select handler should be strings, not objects, some translators (like PubMed.js) do not follow that specification.

As for a fix, I can make a PR that compares the serialized JSON of both items instead, which should be sufficient since one of the two has been serialized already.

dstillman commented 5 years ago

I went with a slightly different fix, but thanks for catching this!