Bug 40361 - Require at least one alphabetic character in first name and surname patron record fields
Summary: Require at least one alphabetic character in first name and surname patron re...
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Patrons (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low enhancement
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-07-14 12:02 UTC by Hannah Dunne-Howrie
Modified: 2025-08-20 10:02 UTC (History)
3 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 Hannah Dunne-Howrie 2025-07-14 12:02:39 UTC
We would like to see if possible to add in some data validation to patron records so that name fields would require at least one alphabetic character to be included otherwise the record should not be saved. We have a workaround using some .js we added in so that the save button won't display (with an explanation note to staff) if this criteria is not met, but it occurs to me this isn't a particularly stable way to do data validation and we would like to see this added to the base code. Giving libraries the control over the criteria by which patron record fields can or cannot save would be a massive improvement in ensuring the quality of patron records.
Comment 1 Katrin Fischer 2025-08-17 11:35:58 UTC
There is BorrowerMandatoryField to make fields mandatory which would require something to be entered before saving. Can you explain, why this is not enough/doesn't work for you?
Comment 2 David Cook 2025-08-17 23:50:11 UTC
(In reply to Katrin Fischer from comment #1)
> There is BorrowerMandatoryField to make fields mandatory which would require
> something to be entered before saving. Can you explain, why this is not
> enough/doesn't work for you?

I believe that they're saying they want additional data validation rules for their name fields for patron records.

--

Server-side data validation of individual fields is a broad topic that has been discussed a bit in Koha, but it's a massive task to make that systematic massive improvement. 

That said, I do think it's something that needs to be done at some point. One of the hardest parts if coming up with a backend design that enough people agree on. 

--

In terms of front-end validation, for opac-memberentry.pl and memberentry.pl it looks like we're using the jQuery Validator plugin. 

It should be fairly easy to use *UserJS to add additional jQuery Validator rules and methods.

Since "name fields would require at least one alphabetic character to be included" isn't a universal rule that would apply to everyone, this might be the most practical approach to take.
Comment 3 Hannah Dunne-Howrie 2025-08-19 08:36:51 UTC
Yes, that's correct. While we can make a field mandatory we are seeing a problem with low quality in name field data. We are seeing accounts created with for example "1" or other numbers added into the name fields instead of actual names. We want to add in some additional data validation rules so we can better control this.
Comment 4 David Cook 2025-08-19 23:03:25 UTC
(In reply to Hannah Dunne-Howrie from comment #3)
> Yes, that's correct. While we can make a field mandatory we are seeing a
> problem with low quality in name field data. We are seeing accounts created
> with for example "1" or other numbers added into the name fields instead of
> actual names. We want to add in some additional data validation rules so we
> can better control this.

By the way, is this for self-registration, OPAC self-modification, staff interface, or all the above?
Comment 5 Hannah Dunne-Howrie 2025-08-20 10:02:00 UTC
Great question. All of the above!