Bug 37143

Summary: Patron registration allows for saving required fields with a single space instead of information
Product: Koha Reporter: Lisette Scheer <lisette>
Component: PatronsAssignee: Lucas Gass (lukeg) <lucas>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: gmcharlt, kyle.m.hall, lucas, wizzyrea
Version: unspecified   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: Bug 37143: Do not allow required fields with only whitespace to be submitted

Description Lisette Scheer 2024-06-20 14:57:17 UTC
When creating a patron or self registration a single space (or series of spaces) can be saved instead of required information in fields. This can cause difficulties in finding patrons.
Comment 1 Liz Rea 2024-06-20 15:08:49 UTC
"difficulties" = 500 error searching for patrons where the erroneous patron is part of the result set.
Comment 2 Lucas Gass (lukeg) 2024-06-20 15:09:13 UTC
This is true for staff interface patron reg as well.
Comment 3 Lucas Gass (lukeg) 2024-06-20 15:22:00 UTC
For example:

1. Do a patron search in the staff interface for all patrons. In k-t-d this works fine.
2. Self register a patron. For the required firstname and surname fields use an empty string like "  ".
3. You can successfully register.
4. Go back to the staff client and do the same patron search, it never completes.
Comment 4 Lucas Gass (lukeg) 2024-06-20 15:30:18 UTC
Created attachment 167936 [details] [review]
Bug 37143: Do not allow required fields with only whitespace to be submitted

To test:
1. Make some fields for OPAC self registration required.
2. Create a new patron via self reg.
3. Fill out those required fields as an empty string like "  ".
4. Submit the form, it succeeds.
5. APPLY PATCH, restart_all
6. Try again. Required fields with only whitespace are treated as if they were empty.