Bug 22602: Fix OverDrive circulation when coming from another site
authorNick Clemens <nick@bywatersolutions.com>
Fri, 6 Sep 2019 11:13:27 +0000 (11:13 +0000)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Fri, 27 Sep 2019 13:00:48 +0000 (14:00 +0100)
On bug 21078 we caught an error and returned, this makes us skip some variable setting that we need.

This patch moves that code into its own function.

To test:
0 - Have OverDrive circulation setup and working
1 - Place a link to your kohadev installation on another site
2 - Follow that link to the opac
3 - Note all items show as 'Place hold' even if available copies
4 - Apply patch
5 - Repeat 1&2
6 - Note the items availability shows correctly

Signed-off-by: Elizabeth Quinn <EQuinn@chplnj.org>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
koha-tmpl/opac-tmpl/bootstrap/js/overdrive.js

index 9070dc3..1e99814 100644 (file)
@@ -86,6 +86,16 @@ KOHA.OverDriveCirculation = new function() {
 
     var checkout_popup = null;
     $( document ).ready(function() {
+        checkout_popup = $("#overdrive-checkout");
+        $("#overdrive-login-form").submit(function(e){
+            e.preventDefault();
+            $("#overdrive-login").modal('hide');
+            var ODpassword = $("input[name='ODpassword']").val();
+            login( ODpassword );
+        });
+    });
+
+    $( document ).ready(function() {
         var p = window.opener;
         if (p) {
             try { cb = p.refresh_overdrive_account_details;}
@@ -97,13 +107,6 @@ KOHA.OverDriveCirculation = new function() {
             }
             window.close();
         }
-        checkout_popup = $("#overdrive-checkout");
-        $("#overdrive-login-form").submit(function(e){
-            e.preventDefault();
-            $("#overdrive-login").modal('hide');
-            var ODpassword = $("input[name='ODpassword']").val();
-            login( ODpassword );
-        });
     });
 
     function display_account (container, data) {