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 <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
David Cook 2026-04-21 00:57:46 +00:00 committed by Lucas Gass
parent 08e66b4f8a
commit 833105aa75
No known key found for this signature in database
GPG Key ID: 60B447398B0D36CA
1 changed files with 4 additions and 2 deletions

View File

@ -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();
}
});
});