From a5fe3d18b2ab47ad90c72fbcd01259b203896d80 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 18 Nov 2022 08:00:24 +0100 Subject: [PATCH] Bug 32260: Patron autocomplete - Do not display an alert if request is rejected Not sure what is going on exactly, neither if this patch is the correct way to fix this. The request is "rejected" at some point (by the browser?), when we search for patrons using the autocomplete and DT "at the same time". To recreate: Don't apply this patch Go to /cgi-bin/koha/reserve/request.pl?biblionumber=1&borrowernumber=5 Search for "edn" then hit enter You may see an alert, that will disappear If you don't see the alert, repeat This patch suggests to ignore the alert if the status of the request is "rejected". --- koha-tmpl/intranet-tmpl/prog/js/patron-autocomplete.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/js/patron-autocomplete.js b/koha-tmpl/intranet-tmpl/prog/js/patron-autocomplete.js index 4189a2df1db..5f0aeb55592 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/patron-autocomplete.js +++ b/koha-tmpl/intranet-tmpl/prog/js/patron-autocomplete.js @@ -45,8 +45,10 @@ function patron_autocomplete(node, options) { success: function(data) { return response(data); }, - error: function() { - alert( _("An error occurred. Check the logs") ); + error: function(e) { + if ( e.state() != 'rejected' ) { + alert( _("An error occurred. Check the logs") ); + } return response(); } }); -- 2.25.1