Bugzilla – Attachment 79327 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.47 KB, created by
Martin Renvoize
on 2018-09-24 17:03:43 UTC
(
hide
)
Description:
Bug 21078: ovedrive.js Catch error if window.opener is not accessible
Filename:
MIME Type:
Creator:
Martin Renvoize
Created:
2018-09-24 17:03:43 UTC
Size:
1.47 KB
patch
obsolete
>From 6ea91e9fccaefb42b31bf723007adb216337da01 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 > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > 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 24717f503e..5cf8170b03 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.18.0
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