From 833105aa75301d2190e177e64a502321841ddaa6 Mon Sep 17 00:00:00 2001 From: David Cook Date: Tue, 21 Apr 2026 00:57:46 +0000 Subject: [PATCH] Bug 42423: Fix patron header search This patch fixes the patron header search, so that you can do patron searches from the header, but empty patron searches are prevented and show a tooltip. Test plan: 0. DO NOT APPLY THE PATCH YET 1. Log into the staff interface and try to search for anything in the "Search patrons" header search 2. Note that nothing happens at all no matter how much you click 3. Apply the patch 4. Refresh the browser page 5. Try to search for anything in the "Seearch patrons" header search 6. Note that it performs the search 7. Empty out the input box and hit Enter or the search button 8. Note that a tooltip appears saying "Please enter a card number or name" Signed-off-by: Jonathan Druart Signed-off-by: Lucas Gass --- koha-tmpl/intranet-tmpl/prog/js/staff-global.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/js/staff-global.js b/koha-tmpl/intranet-tmpl/prog/js/staff-global.js index d067a61f79..00b78a2c66 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/staff-global.js +++ b/koha-tmpl/intranet-tmpl/prog/js/staff-global.js @@ -466,8 +466,10 @@ $(document).ready(function () { }); $("#patron_header_search").on("submit", function (e) { - e.preventDefault(); - validatePatronSearch($(this)[0]); + const validated = validatePatronSearch(e.target); + if (validated !== true) { + e.preventDefault(); + } }); });