Bug 41040 - Empty patron search from the header should not trigger a patron search
Summary: Empty patron search from the header should not trigger a patron search
Status: Signed Off
Alias: None
Product: Koha
Classification: Unclassified
Component: Patrons (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low minor
Assignee: Kyle M Hall (khall)
QA Contact: Testopia
URL:
Keywords: RM_priority
Depends on:
Blocks:
 
Reported: 2025-10-16 23:19 UTC by Kyle M Hall (khall)
Modified: 2025-11-12 18:24 UTC (History)
8 users (show)

See Also:
GIT URL:
Initiative type: ---
Sponsorship status: ---
Comma delimited list of Sponsors:
Crowdfunding goal: 0
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
This fixes the "Search patrons" option in the staff interface menu bar. Currently, clicking "Search patrons" and then the arrow (without entering a value) automatically performs a search. With this change, a patron search is now no longer automatic. If you don't enter anything, or don't select any options, you are now prompted (using a tooltip) to enter a patron name or card number. NOTE: This is a change in behavour from what you may be used to.
Version(s) released in:
Circulation function:


Attachments
Bug 41040: Empty patron search from the header should not trigger a patron search (1.42 KB, patch)
2025-10-17 10:56 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 41040: Empty patron search from the header should not trigger a patron search (1.42 KB, patch)
2025-11-04 15:08 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 41040: Prevent form submission if no filters have been selected (3.73 KB, patch)
2025-11-04 15:08 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 41040: Use tooltip for message instead of alert (1.43 KB, patch)
2025-11-04 15:08 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 41040: Prevent form submission if no filters have been selected (3.76 KB, patch)
2025-11-06 18:13 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 41040: Use tooltip for message instead of alert (1.46 KB, patch)
2025-11-06 18:13 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 41040: (follow-up) Tooltip text change and remove unnecessary class (1.91 KB, patch)
2025-11-06 18:13 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 41040: Empty patron search from the header should not trigger a patron search (1.46 KB, patch)
2025-11-12 12:48 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 41040: Prevent form submission if no filters have been selected (3.76 KB, patch)
2025-11-12 12:48 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 41040: Use tooltip for message instead of alert (1.46 KB, patch)
2025-11-12 12:48 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 41040: (follow-up) Tooltip text change and remove unnecessary class (1.91 KB, patch)
2025-11-12 12:48 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 41040: Empty patron search from the header should not trigger a patron search (1.50 KB, patch)
2025-11-12 18:11 UTC, David Nind
Details | Diff | Splinter Review
Bug 41040: Prevent form submission if no filters have been selected (3.81 KB, patch)
2025-11-12 18:12 UTC, David Nind
Details | Diff | Splinter Review
Bug 41040: Use tooltip for message instead of alert (1.51 KB, patch)
2025-11-12 18:12 UTC, David Nind
Details | Diff | Splinter Review
Bug 41040: (follow-up) Tooltip text change and remove unnecessary class (1.96 KB, patch)
2025-11-12 18:12 UTC, David Nind
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Kyle M Hall (khall) 2025-10-16 23:19:29 UTC
If the "arrow" button on the patron search is clicked with no value in the textbox, it redirects to members/members-home.pl and performs a search with no value automatically. It makes more send for it to behave as the "Patrons" link in the navbar that directs to members-home.pl where the librarian can then perform a more advanced search.
Comment 1 Kyle M Hall (khall) 2025-10-17 10:56:53 UTC Comment hidden (obsolete)
Comment 2 Caroline Cyr La Rose 2025-10-17 18:38:00 UTC
The patch works.

But...

I often use this to get the list of patrons. Although my use case might not be what "normal" staff users do since I don't work in a library.
Comment 3 Kyle M Hall (khall) 2025-10-20 11:20:56 UTC
(In reply to Caroline Cyr La Rose from comment #2)
> The patch works.
> 
> But...
> 
> I often use this to get the list of patrons. Although my use case might not
> be what "normal" staff users do since I don't work in a library.

The letter searches should still work for your use case!
Comment 4 Lucas Gass (lukeg) 2025-10-20 13:11:36 UTC
(In reply to Caroline Cyr La Rose from comment #2)
> The patch works.
> 
> But...
> 
> I often use this to get the list of patrons. Although my use case might not
> be what "normal" staff users do since I don't work in a library.

As a developer, I do this a lot too. But is this actually a work flow any real life librarian uses? Certainly not in a large system.
Comment 5 Caroline Cyr La Rose 2025-10-20 13:13:30 UTC
(In reply to Lucas Gass (lukeg) from comment #4)
> (In reply to Caroline Cyr La Rose from comment #2)
> > The patch works.
> > 
> > But...
> > 
> > I often use this to get the list of patrons. Although my use case might not
> > be what "normal" staff users do since I don't work in a library.
> 
> As a developer, I do this a lot too. But is this actually a work flow any
> real life librarian uses? Certainly not in a large system.

Hence my sentence

> > [...] Although my use case might not
> > be what "normal" staff users do since I don't work in a library.
Comment 6 David Cook 2025-10-20 22:24:11 UTC
(In reply to Lucas Gass (lukeg) from comment #4)
> (In reply to Caroline Cyr La Rose from comment #2)
> > The patch works.
> > 
> > But...
> > 
> > I often use this to get the list of patrons. Although my use case might not
> > be what "normal" staff users do since I don't work in a library.
> 
> As a developer, I do this a lot too. But is this actually a work flow any
> real life librarian uses? Certainly not in a large system.

Reading the comments and I was thinking how I will often do this in KTD but not my real world systems.

If I recall correctly, Keycloak went through a change like this. Years ago, you used to be able to do an empty search to get all users, but these days you have to put in a * to get all users. So that's another option which would cover all use-cases. So long as there was a hint to say that * gets the full list... it could work.
Comment 7 David Cook 2025-10-21 05:41:36 UTC
After trying this one out, I don't think this is ready.

Why not just disable the submit button in the header after it's pressed? 

If you use the filters in the header search to create a search for something like Category: Patron with Library: Centerville and you click search, it won't do the search with this patch. But I think that would break backwards compatibility.
Comment 8 Kyle M Hall (khall) 2025-11-04 15:08:46 UTC Comment hidden (obsolete)
Comment 9 Kyle M Hall (khall) 2025-11-04 15:08:48 UTC Comment hidden (obsolete)
Comment 10 Kyle M Hall (khall) 2025-11-04 15:08:50 UTC Comment hidden (obsolete)
Comment 11 Kyle M Hall (khall) 2025-11-04 15:08:51 UTC
If the "arrow" button on the patron search is clicked with no value in the textbox, it redirects to members/members-home.pl and performs a search with no value automatically. It makes more send for it to behave as the "Patrons" link in the navbar that directs to members-home.pl where the librarian can then perform a more advanced search.
Test Plan:
1) Click the "Search patrons" link on the header, then the arrow button
2) Note an empty patron search is performed immediately
3) Apply this patch
4) Restart all the things!
5) Repeat step 1
6) Note a paton search is no longer triggered automatically
Comment 12 Owen Leonard 2025-11-06 18:13:19 UTC Comment hidden (obsolete)
Comment 13 Owen Leonard 2025-11-06 18:13:22 UTC Comment hidden (obsolete)
Comment 14 Owen Leonard 2025-11-06 18:13:24 UTC Comment hidden (obsolete)
Comment 15 David Nind 2025-11-08 00:16:06 UTC
Getting a sha1/fake ancestor error when applying the patch:

git bz apply 41040

Bug 41040 - Empty patron search from the header should not trigger a patron search

189197 - Bug 41040: Prevent form submission if no filters have been selected
189198 - Bug 41040: Use tooltip for message instead of alert
189199 - Bug 41040: (follow-up) Tooltip text change and remove unnecessary class

Apply? [(y)es, (n)o, (i)nteractive] y
Applying: Bug 41040: Prevent form submission if no filters have been selected
error: sha1 information is lacking or useless (members/member.pl).
error: could not build fake ancestor
Patch failed at 0001 Bug 41040: Prevent form submission if no filters have been selected
Comment 16 Owen Leonard 2025-11-12 12:48:27 UTC
Created attachment 189508 [details] [review]
Bug 41040: Empty patron search from the header should not trigger a patron search

If the "arrow" button on the patron search is clicked with no value in
the textbox, it redirects to members/members-home.pl and performs a
search with no value automatically. It makes more send for it to behave
as the "Patrons" link in the navbar that directs to members-home.pl
where the librarian can then perform a more advanced search.

Test Plan:
1) Click the "Search patrons" link on the header, then the arrow button
2) Note an empty patron search is performed immediately
3) Apply this patch
4) Restart all the things!
5) Repeat step 1
6) Note a paton search is no longer triggered automatically

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 17 Owen Leonard 2025-11-12 12:48:30 UTC
Created attachment 189509 [details] [review]
Bug 41040: Prevent form submission if no filters have been selected

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 18 Owen Leonard 2025-11-12 12:48:33 UTC
Created attachment 189510 [details] [review]
Bug 41040: Use tooltip for message instead of alert

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 19 Owen Leonard 2025-11-12 12:48:36 UTC
Created attachment 189511 [details] [review]
Bug 41040: (follow-up) Tooltip text change and remove unnecessary class

- I think "Please enter a card number or name" sounds friendlier
- We don't add a "btn-primary" class to these buttons
Comment 20 David Nind 2025-11-12 18:11:56 UTC
Created attachment 189517 [details] [review]
Bug 41040: Empty patron search from the header should not trigger a patron search

If the "arrow" button on the patron search is clicked with no value in
the textbox, it redirects to members/members-home.pl and performs a
search with no value automatically. It makes more send for it to behave
as the "Patrons" link in the navbar that directs to members-home.pl
where the librarian can then perform a more advanced search.

Test Plan:
1) Click the "Search patrons" link on the header, then the arrow button
2) Note an empty patron search is performed immediately
3) Apply this patch
4) Restart all the things!
5) Repeat step 1
6) Note a paton search is no longer triggered automatically

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: David Nind <david@davidnind.com>
Comment 21 David Nind 2025-11-12 18:12:00 UTC
Created attachment 189518 [details] [review]
Bug 41040: Prevent form submission if no filters have been selected

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: David Nind <david@davidnind.com>
Comment 22 David Nind 2025-11-12 18:12:04 UTC
Created attachment 189519 [details] [review]
Bug 41040: Use tooltip for message instead of alert

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: David Nind <david@davidnind.com>
Comment 23 David Nind 2025-11-12 18:12:08 UTC
Created attachment 189520 [details] [review]
Bug 41040: (follow-up) Tooltip text change and remove unnecessary class

- I think "Please enter a card number or name" sounds friendlier
- We don't add a "btn-primary" class to these buttons

Signed-off-by: David Nind <david@davidnind.com>
Comment 24 David Nind 2025-11-12 18:22:32 UTC
I think I personally would prefer it going to the patrons page and not automatically doing a search.

But, I'm not sure how this is used in real life.
Comment 25 David Nind 2025-11-12 18:24:25 UTC
(In reply to David Nind from comment #24)
> I think I personally would prefer it going to the patrons page and not
> automatically doing a search.
> 
> But, I'm not sure how this is used in real life.

However, you can get this behavour by clicking the "Patrons" link in the header.