To recreate: 1 - Have a working OverDrive account and setup 2 - Put a link to your koha site on another site and follow the link to open Koha in a new tab.window 3 - Do an overdrive search 4 - Note that copies listed as available are correct, however, all items only have a place hold button The issue is in the code below - if we came from an outside site we cannot access p and we 'return' which never instantiates checkout_popup which is needed for creating the checkout buttons later 87 var checkout_popup = null; 88 $( document ).ready(function() { 89 var p = window.opener; 90 if (p) { 91 try { cb = p.refresh_overdrive_account_details;} 92 catch(err){ return; } //Catch error if opener is not accessible 93 if (cb) { 94 cb(); 95 } else { 96 p.location.reload(); 97 } 98 window.close(); 99 } 100 checkout_popup = $("#overdrive-checkout"); 101 $("#overdrive-login-form").submit(function(e){ 102 e.preventDefault(); 103 $("#overdrive-login").modal('hide'); 104 var ODpassword = $("input[name='ODpassword']").val(); 105 login( ODpassword ); 106 }); 107 });
Created attachment 87352 [details] [review] Bug 22602: Fix OverDrive circulation when coming from another site 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
I was having trouble replicating the original problem, does it still happen for you? Liz
Created attachment 92501 [details] [review] Bug 22602: Fix OverDrive circulation when coming from another site 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>
(In reply to Liz Rea from comment #2) > I was having trouble replicating the original problem, does it still happen > for you? > > Liz Yes, we still have libraries exhibiting this issue
Is there any way to test this without an Overdrive account? Or way to get one for testing purposes?
From: root <root@f1ebe1bec408> You might wanna fix that too ;)
Created attachment 92633 [details] [review] Bug 22602: Fix OverDrive circulation when coming from another site 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>
Created attachment 92821 [details] [review] Bug 23272: (RM followup) Fix failing tests This bug introduced a regression whereby if any authorized value has no branch limitations then the authorized value administration page would fail to display at all. A simple ternary corrects the issue, but I'm now wondering about the logic of returning 'undef' from 'get_branch_limits'.. perhaps an empty (or full) resultset might be a better option to prevent us from requireing ternaries before calling chained methods on such objects. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Bouzid Fergani <bouzid.fergani@inlibro.com>
(In reply to Bouzid Fergani from comment #8) > Created attachment 92821 [details] [review] [review] > Bug 23272: (RM followup) Fix failing tests > > This bug introduced a regression whereby if any authorized value has no > branch limitations then the authorized value administration page would > fail to display at all. > > A simple ternary corrects the issue, but I'm now wondering about the > logic of returning 'undef' from 'get_branch_limits'.. perhaps an empty > (or full) resultset might be a better option to prevent us from > requireing ternaries before calling chained methods on such objects. > > Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> > Signed-off-by: Bouzid Fergani <bouzid.fergani@inlibro.com> Bouzid: buy a new keyboard ;)
Created attachment 93181 [details] [review] Bug 22602: Fix OverDrive circulation when coming from another site 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> Looks good to me, but cannot test Overdrive.
Nice work! Pushed to master for 19.11.00
Pushed to 19.05.x for 19.05.05
backported to 18.11.x for 18.11.11