[Bug 41048] New: Add ability to disallow empty patron searches
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41048 Bug ID: 41048 Summary: Add ability to disallow empty patron searches Change sponsored?: --- Product: Koha Version: unspecified Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Patrons Assignee: koha-bugs@lists.koha-community.org Reporter: kyle@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com, kyle@bywatersolutions.com In high traffic environments with large numbers of patrons, empty patron searches can take a very long time and cause over-use of resources. It would be good to have the option to require search criteria for patron searches. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41048 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |41039 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41039 [Bug 41039] Patron search button can be spammed and trigger many API patron searches -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41048 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |kyle@bywatersolutions.com |ity.org | -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41048 --- Comment #1 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 188111 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=188111&action=edit Bug 41048: Add ability to disallow empty patron searches In high traffic environments with large numbers of patrons, empty patron searches can take a very long time and cause over-use of resources. It would be good to have the option to require search criteria for patron searches. Test Plan: 1) Apply this patch 2) Restart all the things! 3) Enable DisallowEmptyPatronSearches 4) Browse to any patron search form ( such as members-home.pl, or the one on acqui/basket.pl ) 5) Note the search button is disabled when the search is empty, and enabled which the search box contains text -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41048 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41048 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |RM_priority CC| |lucas@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41048 Brendan Lawlor <blawlor@clamsnet.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |blawlor@clamsnet.org --- Comment #2 from Brendan Lawlor <blawlor@clamsnet.org> --- This works for the search_patron_filter input, but it's not exactly as describe in the DisallowEmptyPatronSearches preference. Don't require/Require at least one search criterion when searching for patrons. I think that category code and branch code filters should count as search criteria. I often use an empty search with those two filters so that would discourage me from using this preference even though I appreciate the need for conserving resources for better performance. Would it be reasonable to enable the button on changing one of these filters too? categorycode_filter, branchcode_filter Also on the aquisitions basket manager search there are a couple other search filters: sort1_filter sort2_filter -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41048 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41048 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@gmail.com --- Comment #3 from Jonathan Druart <jonathan.druart@gmail.com> --- Do we really need to controller-side changes? Preventing the submission of the form client-side seems sufficient to me, unless you want to also deal with third-party apps? Tests to cover the API changes are missing, as well as Cypress tests that are required for patron searches. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41048 --- Comment #4 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- (In reply to Jonathan Druart from comment #3)
Do we really need to controller-side changes? Preventing the submission of the form client-side seems sufficient to me, unless you want to also deal with third-party apps?
Tests to cover the API changes are missing, as well as Cypress tests that are required for patron searches.
Yes, the server side changes are necessary due to third party API access. I'll wee what I can do about the unit tests! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41048 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA --- Comment #5 from David Cook <dcook@prosentient.com.au> --- - Noting test plan doesn't mention the database upgrade needed. - The "Search" button remains disabled even when "Category" or "Library" selected which I think would count as "at least one search criterion". I frequently will do an empty search for all staff members for instance. - "Search patrons" in the header search is totally broken for an empty search. "Processing..." graphic stays on the screen and console reports a "501 (Not Implemented)" error. - If you use the header "Search patrons" search, you can configure an empty search with a Category or Library filter, and it'll work. It will then cause the left hand "Search for patron" to have Category or Library populated with an enabled Search button which is contradictory to the behaviour when navigating straight to "Patrons" and trying to use the left-hand "Search for patron" search form. (I'm guessing that maybe this one needs to rely on Bug 41040 as well? Although I'm not convinced that Bug 41040 is a good idea yet...) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41048 --- Comment #6 from David Cook <dcook@prosentient.com.au> --- (In reply to Brendan Lawlor from comment #2)
I think that category code and branch code filters should count as search criteria. I often use an empty search with those two filters so that would discourage me from using this preference even though I appreciate the need for conserving resources for better performance.
Would it be reasonable to enable the button on changing one of these filters too? categorycode_filter, branchcode_filter
Glad to know I'm not the only one who does this! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41048 --- Comment #7 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- *** Bug 42338 has been marked as a duplicate of this bug. *** -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41048 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=41040 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41048 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=9338 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41048 --- Comment #8 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- I am not sure if it should be forbidden as bug 42338 asked for, but maybe made into a more conscious choice or optional, like suggested here. In all our small databases searching for all patrons works well and we do use this feature for some use cases. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41048 Michael Adamyk <michael.adamyk@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |michael.adamyk@bywatersolut | |ions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41048 --- Comment #9 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- (In reply to Katrin Fischer from comment #8)
I am not sure if it should be forbidden as bug 42338 asked for, but maybe made into a more conscious choice or optional, like suggested here. In all our small databases searching for all patrons works well and we do use this feature for some use cases.
Is is optional, controlled via system preference. Is that not sufficient? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41048 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41048 cschrode <cschrode@akronlibrary.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |cschrode@akronlibrary.org -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41048 --- Comment #10 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- (In reply to Kyle M Hall (khall) from comment #9)
(In reply to Katrin Fischer from comment #8)
I am not sure if it should be forbidden as bug 42338 asked for, but maybe made into a more conscious choice or optional, like suggested here. In all our small databases searching for all patrons works well and we do use this feature for some use cases.
Is is optional, controlled via system preference. Is that not sufficient?
It is! I had started commenting on bug 42338 and then moved it here when I found this. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41048 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david@davidnind.com Status|Needs Signoff |Patch doesn't apply --- Comment #11 from David Nind <david@davidnind.com> --- The patch no longer applies 8-(... git bz apply 41048 📋 Bug 41048 - Add ability to disallow empty patron searches • 188111 - Bug 41048: Add ability to disallow empty patron searches Apply? [(y)es, (n)o, (i)nteractive] y Preparing 1 patch(es): ✓ Prepared 1 patch(es) Applying 1 patch(es): Patch application failed for attachment 188111 - Bug 41048: Add ability to disallow empty patron searches Patches left in /tmp/VCK_R5AeNX for manual application if needed To resolve: 1. Fix conflicts (use 'git mergetool' or edit files manually) 2. Stage resolved files with 'git add' 3. Continue with 'git bz apply --continue' or 'git am --continue' 4. Or skip this patch with 'git bz apply --skip' 5. Or abort with 'git bz apply --abort' Error: Apply failed: Git command (git am -3 /tmp/VCK_R5AeNX/0001-188111.patch) failed: error: Failed to merge in the changes. hint: Use 'git am --show-current-patch=diff' to see the failed patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41048 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Patch doesn't apply |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41048 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #188111|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41048 --- Comment #12 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 197787 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=197787&action=edit Bug 41048: Add ability to disallow empty patron searches In high traffic environments with large numbers of patrons, empty patron searches can take a very long time and cause over-use of resources. It would be good to have the option to require search criteria for patron searches. Test Plan: 1) Apply this patch 2) Restart all the things! 3) Enable DisallowEmptyPatronSearches 4) Browse to any patron search form ( such as members-home.pl, or the one on acqui/basket.pl ) 5) Note the search button is disabled when the search is empty, and enabled which the search box contains text -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41048 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41048 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #197787|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41048 --- Comment #13 from David Nind <david@davidnind.com> --- Created attachment 197818 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=197818&action=edit Bug 41048: Add ability to disallow empty patron searches In high traffic environments with large numbers of patrons, empty patron searches can take a very long time and cause over-use of resources. It would be good to have the option to require search criteria for patron searches. Test Plan: 1) Apply this patch 2) Restart all the things! 3) Enable DisallowEmptyPatronSearches 4) Browse to any patron search form ( such as members-home.pl, or the one on acqui/basket.pl ) 5) Note the search button is disabled when the search is empty, and enabled which the search box contains text Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41048 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the| |This enhancement lets you release notes| |determine if empty patron | |searches are allowed in the | |"Search for patron" | |sidebar, used in the staff | |interface on the main | |patrons page, and other | |areas such as adding a | |suggestion manager and the | |managed by patron for | |baskets in acuisitions. | | | |If the new system | |preference | |`DisallowEmptyPatronSearche | |s` is set to require, a | |value is required in the | |search field (until a value | |is entered, the search | |button is dimmed and can't | |be clicked). | | | |Note: This only affects the | |sidebar search, search | |patrons in the staff | |interface header already | |requires entering a partial | |name or card number. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41048 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the|This enhancement lets you |This enhancement lets you release notes|determine if empty patron |determine if empty patron |searches are allowed in the |searches are allowed in the |"Search for patron" |"Search for patron" |sidebar, used in the staff |sidebar, used in the staff |interface on the main |interface on the main |patrons page, and other |patrons page, and other |areas such as adding a |areas such as adding a |suggestion manager and the |suggestion manager and the |managed by patron for |managed by patron for |baskets in acuisitions. |baskets in acquisitions. | | |If the new system |If the new system |preference |preference |`DisallowEmptyPatronSearche |`DisallowEmptyPatronSearche |s` is set to require, a |s` is set to require, a |value is required in the |value is required in the |search field (until a value |search field (until a value |is entered, the search |is entered, the search |button is dimmed and can't |button is dimmed and can't |be clicked). |be clicked). | | |Note: This only affects the |Note: This only affects the |sidebar search, search |sidebar search, search |patrons in the staff |patrons in the staff |interface header already |interface header already |requires entering a partial |requires entering a partial |name or card number. |name or card number. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41048 --- Comment #14 from David Cook <dcook@prosentient.com.au> --- So I haven't tried this patch yet, but it seems like the the top bar Search Patrons might be broken in main... thought it might be related to this bug but I guess not... -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41048 --- Comment #15 from David Cook <dcook@prosentient.com.au> --- Wait so this is for the sidebar and bug 41040 is for the top bar? Ok I think that's the one that breaks it... -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41048 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the|This enhancement lets you |This enhancement lets you release notes|determine if empty patron |determine if empty patron |searches are allowed in the |searches are allowed in the |"Search for patron" |"Search for patron" |sidebar, used in the staff |sidebar, used in the staff |interface on the main |interface on the main |patrons page, and other |patrons page, and other |areas such as adding a |areas such as adding a |suggestion manager and the |suggestion manager and the |managed by patron for |managed by patron for |baskets in acquisitions. |baskets in acquisitions. | | |If the new system |If the new system |preference |preference |`DisallowEmptyPatronSearche |`DisallowEmptyPatronSearche |s` is set to require, a |s` is set to require, a |value is required in the |value is required in the |search field (until a value |search field (until a value |is entered, the search |is entered, the search |button is dimmed and can't |button is dimmed and can't |be clicked). |be clicked). | | |Note: This only affects the |Note: This only affects the |sidebar search, search |sidebar search, search |patrons in the staff |patrons in the staff |interface header already |interface header already |requires entering a partial |requires entering a partial |name or card number. |name or card number (added | |by Bug 41040 - Empty patron | |search from the header | |should not trigger a patron | |search, in 26.05, and | |backported to 25.11 and | |25.05). --- Comment #16 from David Nind <david@davidnind.com> --- (In reply to David Cook from comment #15)
Wait so this is for the sidebar and bug 41040 is for the top bar? Ok I think that's the one that breaks it...
Yep - this one is for the sidebar. I didn't notice anything broken - header seems fine to me, and worked before and after this patch. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41048 --- Comment #17 from David Nind <david@davidnind.com> --- (In reply to David Nind from comment #16)
(In reply to David Cook from comment #15)
Wait so this is for the sidebar and bug 41040 is for the top bar? Ok I think that's the one that breaks it...
Yep - this one is for the sidebar. I didn't notice anything broken - header seems fine to me, and worked before and after this patch.
So it's broken on 25.05, not main, which is why it was working for me. Will add Bug 42423 to me list of bugs to signoff. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41048 --- Comment #18 from Jonathan Druart <jonathan.druart@gmail.com> --- Should not DisallowEmptyPatronSearches drive the behaviour of the header search as well? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41048 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Patch doesn't apply --- Comment #19 from Jonathan Druart <jonathan.druart@gmail.com> --- Bad conflict resolution on sysprefs.sql -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41048 --- Comment #20 from David Nind <david@davidnind.com> --- (In reply to Jonathan Druart from comment #18)
Should not DisallowEmptyPatronSearches drive the behaviour of the header search as well?
I'd support that! (It would seem off to configure that you can and can't in one area, but not the other.) I'd also suggest renaming the system preference to EmptyPatronSearches. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41048 --- Comment #21 from Jonathan Druart <jonathan.druart@gmail.com> --- Note that I've added a Cypres test on bug 42423. It should be adjusted if the pref affect it, and a new test added for the sidebar. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41048 --- Comment #22 from David Nind <david@davidnind.com> --- (In reply to David Nind from comment #17)
(In reply to David Nind from comment #16)
(In reply to David Cook from comment #15)
Wait so this is for the sidebar and bug 41040 is for the top bar? Ok I think that's the one that breaks it...
Yep - this one is for the sidebar. I didn't notice anything broken - header seems fine to me, and worked before and after this patch.
So it's broken on 25.05, not main, which is why it was working for me. Will add Bug 42423 to me list of bugs to signoff.
I can "see" the problem now. I've always relied (when testing) on the autocomplete. If the search you enter doesn't show any autocomplete results, clicking the arrow to search doesn't do anything. (Although, what is searched is determined by the DefaultPatronSearchFields system preference. If what you enter isn't covered by any of those fields, it's not going to show up in the autocomplete, and you will get no results anyway(?)) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41048 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Patch doesn't apply |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41048 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41048 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Failed QA --- Comment #23 from Jonathan Druart <jonathan.druart@gmail.com> --- Adjusting status regarding the last comments. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41048 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |42643 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42643 [Bug 42643] [OMNIBUS] Assorted performance and stability work -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41048 Kati Sillgren <kati.sillgren@porvoo.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kati.sillgren@porvoo.fi --- Comment #24 from Kati Sillgren <kati.sillgren@porvoo.fi> --- *** Bug 37900 has been marked as a duplicate of this bug. *** -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41048 --- Comment #25 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 199766 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=199766&action=edit Bug 41048: Add ability to disallow empty patron searches In high traffic environments with large numbers of patrons, empty patron searches can take a very long time and cause over-use of resources. It would be nice to have the option to require search criteria for patron searches. This patch adds a new system preference EmptyPatronSearches. When set to "Don't allow", a patron search with no criteria is rejected, both in the staff interface and via the REST API. In the staff interface the "Search for patron" button in the sidebar is disabled until a search term is entered or a library, category or sort filter is selected, and the header "Search patrons" form refuses an empty search. Filters like category and library count as search criteria, so a search limited only by those is still allowed. On the REST API, a request to /api/v1/patrons with no query is rejected with a 422 and the error_code 'empty_search_not_allowed'. Test Plan: 1) Apply this patch 2) Run updatedatabase.pl 3) Restart all the things! 4) Browse to Administration and note the new EmptyPatronSearches system preference, set it to "Don't allow" 5) Browse to the patrons home page ( members-home.pl ) 6) Note the sidebar "Search for patron" button is disabled when the form is empty, and enabled once you enter a term or pick a library, category or sort filter 7) Note the header "Search patrons" search refuses an empty search 8) Set EmptyPatronSearches to "Allow" 9) Note empty searches are allowed again in both the sidebar and header! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41048 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #199766|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41048 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41048 Kyle M Hall (khall) <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #197818|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41048 --- Comment #26 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 199773 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=199773&action=edit Bug 41048: Add ability to disallow empty patron searches In high traffic environments with large numbers of patrons, empty patron searches can take a very long time and cause over-use of resources. It would be good to have the option to require search criteria for patron searches. Test Plan: 1) Apply this patch 2) Restart all the things! 3) Enable DisallowEmptyPatronSearches 4) Browse to any patron search form ( such as members-home.pl, or the one on acqui/basket.pl ) 5) Note the search button is disabled when the search is empty, and enabled which the search box contains text Signed-off-by: David Nind <david@davidnind.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41048 --- Comment #27 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 199774 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=199774&action=edit Bug 41048: (QA follow-up) Address QA feedback This patch addresses the QA feedback on the previous patch: - Rename the system preference to EmptyPatronSearches and reframe the options as "Allow"/"Don't allow", defaulting to "Allow" so the current behaviour is unchanged - Fix the bad conflict resolution in sysprefs.sql - Count the library, category and sort filters as search criteria so the sidebar search button is enabled when any of them is set, not only when the search box contains text - Make the preference drive the header "Search patrons" form as well - Fix the atomicupdate description typo and report success or failure via say_success/say_failure Test Plan: 1) Apply this patch 2) Run updatedatabase.pl 3) Restart all the things! 4) Set the EmptyPatronSearches system preference to "Don't allow" 5) Browse to the patrons home page ( members-home.pl ) 6) Note the sidebar "Search for patron" button is disabled when the form is empty, and enabled once you enter a term or pick a library, category or sort filter 7) Note the header "Search patrons" search refuses an empty search 8) Set EmptyPatronSearches to "Allow" 9) Note empty searches are allowed again in both the sidebar and header! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41048 --- Comment #28 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 199775 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=199775&action=edit Bug 41048: (QA follow-up) Add unit tests Patch from commit 92b246e -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41048 --- Comment #29 from Kyle M Hall (khall) <kyle@bywatersolutions.com> --- Created attachment 199776 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=199776&action=edit Bug 41048: (QA follow-up) Add a Cypress test Patch from commit d0219e2 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41048 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the|This enhancement lets you |This enhancement lets you release notes|determine if empty patron |determine if empty patron |searches are allowed in the |searches are allowed in the |"Search for patron" |"Search for patron" |sidebar, used in the staff |sidebar, used in the staff |interface on the main |interface on the main |patrons page, and other |patrons page, and other |areas such as adding a |areas such as adding a |suggestion manager and the |suggestion manager and the |managed by patron for |managed by patron for |baskets in acquisitions. |baskets in acquisitions. | | |If the new system |If the new system |preference |preference |`DisallowEmptyPatronSearche |`EmptyPatronSearches` is |s` is set to require, a |set to 'Don't allow', a |value is required in the |value is required in the |search field (until a value |search field (until a value |is entered, the search |is entered, the search |button is dimmed and can't |button is dimmed and can't |be clicked). |be clicked). | | |Note: This only affects the |Note: This only affects the |sidebar search, search |sidebar search, search |patrons in the staff |patrons in the staff |interface header already |interface header already |requires entering a partial |requires entering a partial |name or card number (added |name or card number (added |by Bug 41040 - Empty patron |by Bug 41040 - Empty patron |search from the header |search from the header |should not trigger a patron |should not trigger a patron |search, in 26.05, and |search, in 26.05, and |backported to 25.11 and |backported to 25.11 and |25.05). |25.05). -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41048 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |43016 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43016 [Bug 43016] [OMNIBUS] Server resource protection -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=41048 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks|42643 | CC| |andrew@bywatersolutions.com Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42643 [Bug 42643] [OMNIBUS] Assorted performance and stability work -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org