Bug 21078 - Overdrive JS breaks when window opened from another site
Summary: Overdrive JS breaks when window opened from another site
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Nick Clemens
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks: 22602
  Show dependency treegraph
 
Reported: 2018-07-14 14:29 UTC by Nick Clemens
Modified: 2020-06-04 20:33 UTC (History)
3 users (show)

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


Attachments
Bug 21078: ovedrive.js Catch error if window.opener is not accessible (1.40 KB, patch)
2018-07-14 14:32 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 21078: ovedrive.js Catch error if window.opener is not accessible (1.47 KB, patch)
2018-09-24 17:03 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 21078: overdrive.js Catch error if window.opener is not accessible (1.52 KB, patch)
2018-09-27 17:02 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Clemens 2018-07-14 14:29:49 UTC
Some libraries use a homepage outside of koha and a widget to open the catalog. When doing this the overdrive.js is unable to access the window.opener properties and dies.
Comment 1 Nick Clemens 2018-07-14 14:32:54 UTC
Created attachment 76965 [details] [review]
Bug 21078: ovedrive.js Catch error if window.opener is not accessible

To Test:
0 - Enable overdrive search results on your koha
1 - From an source develop a link to your koha instance that opens a new
window:
<a target="_blank"
href="http://localhost:8080/cgi-bin/koha/opac-search.pl?q=love">Test</a>
2 - Click that link
3 - Note Overdrive results do not load
4 - Note error in JS console
5 - Apply patch
6 - Click the link again
7 - Note OD results load
8 - Note no error in console
Comment 2 Martin Renvoize 2018-09-24 17:03:43 UTC
Created attachment 79327 [details] [review]
Bug 21078: ovedrive.js Catch error if window.opener is not accessible

To Test:
0 - Enable overdrive search results on your koha
1 - From an source develop a link to your koha instance that opens a new
window:
<a target="_blank"
href="http://localhost:8080/cgi-bin/koha/opac-search.pl?q=love">Test</a>
2 - Click that link
3 - Note Overdrive results do not load
4 - Note error in JS console
5 - Apply patch
6 - Click the link again
7 - Note OD results load
8 - Note no error in console

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 3 Martin Renvoize 2018-09-24 17:04:12 UTC
Works as expected, Signing off.
Comment 4 Katrin Fischer 2018-09-27 17:02:49 UTC
Created attachment 79544 [details] [review]
Bug 21078: overdrive.js Catch error if window.opener is not accessible

To Test:
0 - Enable overdrive search results on your koha
1 - From a source develop a link to your koha instance that opens a new
window:
<a target="_blank"
href="http://localhost:8080/cgi-bin/koha/opac-search.pl?q=love">Test</a>
2 - Click that link
3 - Note Overdrive results do not load
4 - Note error in JS console
5 - Apply patch
6 - Click the link again
7 - Note OD results load
8 - Note no error in console

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 5 Nick Clemens 2018-09-28 19:56:35 UTC
Awesome work all!

Pushed to master for 18.11
Comment 6 Martin Renvoize 2018-10-03 09:38:45 UTC
Pushed to 18.05.x for 18.05.05
Comment 7 Fridolin Somers 2018-10-10 10:08:55 UTC
Pushed to 17.11.x for 17.11.11