Bug 31746 - Patron record saves when cardnumber required and value entered is whitespace
Summary: Patron record saves when cardnumber required and value entered is whitespace
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Patrons (show other bugs)
Version: 21.11
Hardware: All All
: P4 enhancement
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-10-12 17:41 UTC by John Yorio
Modified: 2025-09-12 07:08 UTC (History)
5 users (show)

See Also:
GIT URL:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Yorio 2022-10-12 17:41:28 UTC
This happens both with the full patron entry form and the quick add form.

When the cardnumber is required, it's possible to enter either spaces or non-printing characters into the cardnumber field and save the record. That is, there's nothing but whitespace. The value of cardnumber saved in the database in this case is NULL.

It would be helpful if Koha verified that the cardnumber field contained something other than whitespace and prevented it from saving if it did not, when the cardnumber is required.

I'm not sure if this relates to bug 30978 in any way, but I'm referencing it here just in case.
Comment 1 E-P Keskitalo 2025-09-11 08:38:57 UTC
This seems to be alive in 25.05. We found a patron without a cardnumber, or rather, a whitespace as the cardnumber. 

I am not sure, should I keep the original version indication, or refresh it.
Comment 2 David Cook 2025-09-12 07:08:38 UTC
(In reply to E-P Keskitalo from comment #1)
> This seems to be alive in 25.05. We found a patron without a cardnumber, or
> rather, a whitespace as the cardnumber. 

Yikes. That's no good!

> I am not sure, should I keep the original version indication, or refresh it.

Doesn't really matter too much. In a case like this, I usually leave it, since in theory it could help maintainers know that it's likely it needs to be backported back a long way.