Bug 41039

Summary: Patron search button can be spammed and trigger many API patron searches
Product: Koha Reporter: Kyle M Hall (khall) <kyle>
Component: PatronsAssignee: Kyle M Hall (khall) <kyle>
Status: Signed Off --- QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: caroline.cyr-la-rose, dbarden, dcook, gmcharlt, kkrueger, kyle, lucas
Version: unspecifiedKeywords: RM_priority
Hardware: All   
OS: All   
GIT URL: Change sponsored?: ---
Patch complexity: --- Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
Circulation function:
Bug Depends on:    
Bug Blocks: 41048    
Attachments: Bug 41039: Prevent patron search button from being spammed triggering multiple api requests
Bug 41039: Prevent patron search button from being spammed triggering multiple api requests

Description Kyle M Hall (khall) 2025-10-16 23:09:22 UTC
Every click of the "Search" button on members/members-home.pl will trigger another patron search api request. This button should be disabled until the first searches results are displayed.

To demonstrate, open the network tab of the developer console on your web browser. Note each click if the button show another patron search api request.
Comment 1 Kyle M Hall (khall) 2025-10-17 11:20:49 UTC
Created attachment 188063 [details] [review]
Bug 41039: Prevent patron search button from being spammed triggering multiple api requests

Every click of the "Search" button on members/members-home.pl or other area that utilizes patrons searching,
will trigger another patron search api request. This button should be disabled until the first searches results are displayed.

To demonstrate, open the network tab of the developer console on your web browser. Note each click if the button show another patron search api request.

Test Plan:
1) Browse to members-home.pl
2) Open the network tab of the developer console on your web browser
3) Double click the Search button
4) Note the two api requests in the network tab
5) Apply this patch
6) Reload the page
7) Double click the Search button
8) Note only one api request is made

If your results come back too fast, you may perform an initial search,
then change the number of results from the default 20 to "All" to
create a search that will take longer.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 2 Caroline Cyr La Rose 2025-10-17 19:15:16 UTC
Created attachment 188123 [details] [review]
Bug 41039: Prevent patron search button from being spammed triggering multiple api requests

Every click of the "Search" button on members/members-home.pl or other area that utilizes patrons searching,
will trigger another patron search api request. This button should be disabled until the first searches results are displayed.

To demonstrate, open the network tab of the developer console on your web browser. Note each click if the button show another patron search api request.

Test Plan:
1) Browse to members-home.pl
2) Open the network tab of the developer console on your web browser
3) Double click the Search button
4) Note the two api requests in the network tab
5) Apply this patch
6) Reload the page
7) Double click the Search button
8) Note only one api request is made

If your results come back too fast, you may perform an initial search,
then change the number of results from the default 20 to "All" to
create a search that will take longer.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Comment 3 Caroline Cyr La Rose 2025-10-17 19:15:51 UTC
I needed to put it in "Need Signoff" to then go to "Signed off". Sorry!