Bug 37143 - Patron registration allows for saving required fields with a single space instead of information
Summary: Patron registration allows for saving required fields with a single space ins...
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Patrons (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low enhancement
Assignee: Lucas Gass (lukeg)
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-06-20 14:57 UTC by Lisette Scheer
Modified: 2024-06-20 15:31 UTC (History)
4 users (show)

See Also:
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 (1.17 KB, patch)
2024-06-20 15:30 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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.