Bugzilla – Attachment 76965 Details for
Bug 21078
Overdrive JS breaks when window opened from another site
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21078: ovedrive.js Catch error if window.opener is not accessible
Bug-21078-ovedrivejs-Catch-error-if-windowopener-i.patch (text/plain), 1.40 KB, created by
Nick Clemens
on 2018-07-14 14:32:54 UTC
(
hide
)
Description:
Bug 21078: ovedrive.js Catch error if window.opener is not accessible
Filename:
MIME Type:
Creator:
Nick Clemens
Created:
2018-07-14 14:32:54 UTC
Size:
1.40 KB
patch
obsolete
>From 0466ca9dc63e406015d827072e4259c45edda4ad Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Sat, 14 Jul 2018 14:29:53 +0000 >Subject: [PATCH] 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 >--- > koha-tmpl/opac-tmpl/bootstrap/js/overdrive.js | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/js/overdrive.js b/koha-tmpl/opac-tmpl/bootstrap/js/overdrive.js >index 24717f5..5cf8170 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/js/overdrive.js >+++ b/koha-tmpl/opac-tmpl/bootstrap/js/overdrive.js >@@ -86,7 +86,8 @@ KOHA.OverDriveCirculation = new function() { > $( document ).ready(function() { > var p = window.opener; > if (p) { >- cb = p.refresh_overdrive_account_details; >+ try { cb = p.refresh_overdrive_account_details;} >+ catch(err){ return; } //Catch error if opener is not accessible > if (cb) { > cb(); > } else { >-- >2.1.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 21078
:
76965
|
79327
|
79544