From 7e440d700904fde37b54138da0e7a9c38ff2637a Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Thu, 4 Jun 2015 07:13:01 -0400 Subject: [PATCH] Bug 14318: iDreamBooks doesn't work when Koha is using https If a Koha server is configured to run over SSL, all iDreamBooks content is blocked due to the fact that a secure page is requesting an insecure endpoint. This is due to the fact that the urls for iDreamBooks use http and not https. A simple fix would be to switch them to https since browsers have to qualms about loading a secure data endpoint from an insecure one. Test Plan: 1) Enable iDreamBooks 2) Set up your OPAC to use https 3) Verify iDreamBooks content continues to work Note: tested Chrome and IE, so that the IE change would be validated. Discovered isbn semi-colon issue that is beyond scope of this bug. Signed-off-by: Mark Tompsett Signed-off-by: Katrin Fischer Signed-off-by: Tomas Cohen Arazi --- .../prog/en/modules/admin/preferences/enhanced_content.pref | 6 +++--- koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt | 6 +++--- koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/enhanced_content.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/enhanced_content.pref index 30025468ae..1e68153050 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/enhanced_content.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/enhanced_content.pref @@ -147,19 +147,19 @@ Enhanced Content: choices: yes: Add no: "Don't add" - - a tab on the OPAC details with book reviews from critics aggregated by IDreamBooks.com. + - a tab on the OPAC details with book reviews from critics aggregated by IDreamBooks.com. - - pref: IDreamBooksReadometer choices: yes: Add no: "Don't add" - - a "Readometer" that summarizes the reviews gathered by IDreamBooks.com to the OPAC details page. + - a "Readometer" that summarizes the reviews gathered by IDreamBooks.com to the OPAC details page. - - pref: IDreamBooksResults choices: yes: Add no: "Don't add" - - the rating from IDreamBooks.com to OPAC search results. + - the rating from IDreamBooks.com to OPAC search results. OCLC: - - pref: XISBN diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt index 21b287128d..840f6ecce9 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt @@ -1612,7 +1612,7 @@ if ($.browser.msie && parseInt($.browser.version, 10) >= 8 && window.XDomainRequest) { // Use Microsoft XDR for IE version 8 or above var xdr = new XDomainRequest(); - xdr.open("get", "http://idreambooks.com/newbooks/api.json?q="+encodeURIComponent(isbn)+"&key=8bf66516232d1b72f3e47df939653e1e"); + xdr.open("get", "https://idreambooks.com/newbooks/api.json?q="+encodeURIComponent(isbn)+"&key=8bf66516232d1b72f3e47df939653e1e"); xdr.onload = function() { json = 'json = '+xdr.responseText; // the string now looks like.. json = { ... }; eval(json); // json is now a regular JSON object @@ -1620,7 +1620,7 @@ } xdr.send(); } else { - $.getJSON("http://idreambooks.com/newbooks/api.json?q="+encodeURIComponent(isbn)+"&key=8bf66516232d1b72f3e47df939653e1e", function(json){ + $.getJSON("https://idreambooks.com/newbooks/api.json?q="+encodeURIComponent(isbn)+"&key=8bf66516232d1b72f3e47df939653e1e", function(json){ parseIDBJSON(json); }); } @@ -1635,7 +1635,7 @@ isbn = isbn.replace(/-/, ''); [% IF ( IDreamBooksReadometer ) %] - $(".title").append(''+json.book.title+' by '+json.book.author+''); + $(".title").append(''+json.book.title+' by '+json.book.author+''); [% END %] [% IF ( IDreamBooksReviews ) %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt index 27c5a1058a..d905f137b3 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt @@ -711,7 +711,7 @@ $(document).ready(function(){ if ($.browser.msie && parseInt($.browser.version, 10) >= 8 && window.XDomainRequest) { // Use Microsoft XDR for IE version 8 or above var xdr = new XDomainRequest(); - xdr.open("get", "http://idreambooks.com/newbooks/api.json?q="+encodeURIComponent(isbn)+"&key=8bf66516232d1b72f3e47df939653e1e"); + xdr.open("get", "https://idreambooks.com/newbooks/api.json?q="+encodeURIComponent(isbn)+"&key=8bf66516232d1b72f3e47df939653e1e"); xdr.onload = function() { json = 'json = '+xdr.responseText; // the string now looks like.. json = { ... }; eval(json); // json is now a regular JSON object @@ -724,7 +724,7 @@ $(document).ready(function(){ } xdr.send(); } else { - $.getJSON("http://idreambooks.com/newbooks/api.json?q="+encodeURIComponent(isbn)+"&key=8bf66516232d1b72f3e47df939653e1e", function(json){ + $.getJSON("https://idreambooks.com/newbooks/api.json?q="+encodeURIComponent(isbn)+"&key=8bf66516232d1b72f3e47df939653e1e", function(json){ if(json.total_results > 0 && json.book.rating > 0){ $(element).children('a').html(""+json.book.title+" by "+json.book.author+""+json.book.rating+"%"); $(element).show(); -- 2.39.5