Bug 12331 - can't save results to zotero
Summary: can't save results to zotero
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Web services (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-05-29 18:43 UTC by Nicole C. Engard
Modified: 2019-10-14 19:57 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
zotero error (217.05 KB, image/png)
2014-05-29 18:43 UTC, Nicole C. Engard
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nicole C. Engard 2014-05-29 18:43:28 UTC
Created attachment 28562 [details]
zotero error

Zotero works A-OK when saving an individual title but on the results page when you click the folder in the address bar you get an error. The error gives no useful info though so I'm not sure what's causing it.
Comment 1 Bernardo Gonzalez Kriegel 2014-06-27 01:22:50 UTC
Nicole,
this is not a problem of Koha, it's on Zotero's Koha translator[1]
This 'translator' works extracting appropriate urls from results page

They are using this code to get the result list:

var titles = doc.evaluate('//span[@class="results_summary"]/span[@class="label"]/a[contains(@href, "opac-detail.pl")]|//span[@class="results_summary"]/preceding-sibling::a[contains(@href, "opac-detail.pl")]', doc, null, XPathResult.ANY_TYPE, null);

Perhaps someone that understand better (Owen?) can said if that sentence gives useful results, or not.

I any case, problem is on Zotero side, perhaps we could help (not me)

[1] https://github.com/zotero/translators/blob/master/Library%20Catalog%20%28Koha%29.js
Comment 2 Nicole C. Engard 2014-07-03 15:22:00 UTC
I don't really understand all that - can you explain it such that I could report the bug to them - or could you report the bug to them?
Comment 3 Bernardo Gonzalez Kriegel 2014-07-03 16:45:48 UTC
(In reply to Nicole C. Engard from comment #2)
> I don't really understand all that - can you explain it such that I could
> report the bug to them - or could you report the bug to them?

I'm not a user of Zotero :(, 
will try to explain.

Zotero uses "translators"[1] to detect and add records/objects.
They are JavaScript functions, and there are plenty of them [2]

In the case of Koha Zotero translator [3], they have a function
to detect a single record (opac-detail in url) or multiple
(opac-results in url). For multiple results, they parse the
html looking for something with structure

<span class="results_summary">
  <span class="label">
    <a href="...opac-detail.pl...">

but we don't have that. perhaps something like
<td class="bibliocol">
  <a class="title" href="...opac-detail.pl...">

My hope was that Owen could take a look and perhaps suggest a correct
XPath expression so Mr. Sebastian Karcher (creator) could fix the translator.

In summary, I think the problem they have is an incorrect XPath expression when parsing multiple results.

[1] https://www.zotero.org/support/translators
[2] https://github.com/zotero/translators
[3] https://github.com/zotero/translators/blob/master/Library%20Catalog%20(Koha).js
Comment 4 Francisco Peixoto 2015-10-07 15:04:32 UTC
Good evening

Dear Nicole and Bernardo

Probably you still didn't reach any solution for this. I'am also having problems with Zotero Koha connector and I reported in the Zotero forum

https://forums.zotero.org/discussion/52521/koha-translator/#Item_5

The problem I reported is a bit different but might be connected with this one.

The problem I reported I face it in different catalogs even on the Bywater demo OPAC.

Hope this could be a way to solve the problem.

Thanks
Kind regards
Francisco
Comment 5 Jon Knight 2017-12-11 09:52:22 UTC
Looking at that Zotero thread, it appears that this was fixed successfully on the Zotero side? We're not Zotero users here so I thought I'd ping out a check to see if there was anything that was still needed on the Koha side before closing this bug report.
Comment 6 Owen Leonard 2018-05-31 16:37:02 UTC
Zotero appears to be working now. If someone finds otherwise they can re-open with more details.