Summary: | The z39.50 authority search to create new auth record works randomly | ||
---|---|---|---|
Product: | Koha | Reporter: | Zeno Tajoli <ztajoli> |
Component: | MARC Authority data support | Assignee: | Galen Charlton <gmcharlt> |
Status: | CLOSED FIXED | QA Contact: | Testopia <testopia> |
Severity: | normal | ||
Priority: | P3 | CC: | bgkriegel, giuseppe.angilella, jonathan.druart, library, veron |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
See Also: | http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12295 | ||
Change sponsored?: | --- | Patch complexity: | Trivial patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Circulation function: | |||
Attachments: | Bug 12266 - The z39.50 authority search to create new auth record works randomly |
Description
Zeno Tajoli
2014-05-15 13:45:49 UTC
Hi to all, With Koha version 3.17.00.007 (Current Master), I get no Z39.50 search at all. With 3.14.01.000 it works as expected. Tested with Firefox 29.01 on Win 7. All popups allowed. Same behaviour with Chrome 35.0.1916.114 m To reproduce: Step 1) ------ Go to .../cgi-bin/koha/authorities/authorities-home.pl Result: Error in console: Time: 02.06.2014 16:03:24 Error: SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data Source: .../cgi-bin/koha/authorities/authorities-home.pl Line: 126 This line reads: alreadySelected = JSON.parse(alreadySelected); Step 2) ------ Click "New from Z39.50" Result: Popup window should open but nothing happens. URL changes to .../cgi-bin/koha/authorities/authorities-home.pl# (same as in Zeno's remarks) 3 identical warnings in console: Time: 02.06.2014 16:07:24 Warning: Empty string passed to getElementById(). Source: .../intranet-tmpl/lib/jquery/jquery.js Line: 2 -- I change importance to P3 (Seriously broken, but not high impact) Oh, found: There are two lines: if (alreadySelected !== null) but this works only when the variable alreadySelected is defined. I add a test for defined - the Popup works. (However it's puzzling that the same code worked with 3.14) Patch follows. Created attachment 28620 [details] [review] Bug 12266 - The z39.50 authority search to create new auth record works randomly Test scenario: Make sure that Z39.50 servers for authorities are defined (e.g. form Library of Congress) Go to Authorities Click on "Z39.50 search" Without patch it can happen that the popup window for Z39.50 does not show up Apply patch Reload page Click again on "Z39.50 search" Pop up window should now display as expected. I manually edited the authorities_js.inc on my test system according to Marc's patch. It restored the past functionality of the z39.50 add new authority setup, which we use often (we're currently cleaing up our authorities database and standardizing it). Pushed to our production system after testing and also seems to fix the problem. Hi Ian, Is it possible to sign off? Thanks Marc Same problem here (after a package update). Fixed by manually editing authorities_js.inc according to Marc Véron's patch. 15 minutes to spot the problem, (quench panic), and find your solution: Many thanks! Hi Marc, in fact bug 12295 is fixed working on the same lines of your patch. Clear you need to rebase, it is possible that the bug is over. Hi Zeno, After the latest pull (3.17.00.007, including Bug 12295), the z39.50 search window pops up as expected. However I have a question: Original code: var alreadySelected = $.cookie('auth_to_merge'); if (alreadySelected !== null) { (...) } if-statement in Patch for Bug 12295: if (alreadySelected !== undefined) if-statement in Patch for Bug 12266: if ((typeof alreadySelected !== 'undefined') && (alreadySelected !== null)) Question: For some reason there was a test for null in the original code. Is it ever possible that $.cookie('auth_to_merge') results to null? If yes, I suppose that it should be tested as well. (In reply to Marc Véron from comment #7) > > Question: > For some reason there was a test for null in the original code. > Is it ever possible that $.cookie('auth_to_merge') results to null? If yes, > I suppose that it should be tested as well. On Bug 12295: "... newer versions of jquery-cookie changed the return of $.cookie('foo') from null to undefined when the cookie is not present." Seems that checking for null is not required. Thanks, Bernardo. I change the status to RESOLVED FIXED (In reply to Marc Véron from comment #4) > Hi Ian, > > Is it possible to sign off? > > Thanks > > Marc Marc, I'm not yet very experienced in git, just a amateur hacker, so don't even know how to go about doing a sign off. Perhaps this summer I need to take a bit of free time and learn. Thanks for the work on the bug. Ian, In the meantime the Bug is fixed, no sign-off necessary. BTW regarding Sign-off and Git: http://wiki.koha-community.org/wiki/Version_Control_Using_Git http://wiki.koha-community.org/wiki/Git_bz_configuration ...and on the IRC channel you always find great support You can also test and sign off patches using sandboxes http://wiki.koha-community.org/wiki/Sandboxes |