From 09c2b96e0424507dd2a7b8636d582985a3998243 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". Signed-off-by: Owen Leonard Signed-off-by: Katrin Fischer Signed-off-by: Tomas Cohen Arazi --- 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 6057cb8473..ba4f9f9b9d 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.39.5