Bug 39579

Summary: Add ability to restrict patron date of birth on self registration
Product: Koha Reporter: Alexander Blanchard <alexander.blanchard>
Component: PatronsAssignee: Alexander Blanchard <alexander.blanchard>
Status: Pushed to main --- QA Contact: Lisette Scheer <lisette>
Severity: enhancement    
Priority: P5 - low CC: e.betemps, gmcharlt, kyle.m.hall, lisette, martin.renvoize, sally.healey
Version: Main   
Hardware: All   
OS: All   
GIT URL: Change sponsored?: ---
Patch complexity: --- Documentation contact:
Documentation submission: Text to go in the release notes:
This new feature adds a new system preference `PatronSelfRegistrationAgeRestriction` to restrict the maximum age of patrons self registering.
Version(s) released in:
25.05.00
Circulation function:
Attachments: Bug 39579: Restrict Patron Self Reg Date of Birth
Bug 39579: Restrict Patron Self Reg Date of Birth
Bug 39579: Restrict Patron Self Reg Date of Birth
Bug 39579: (QA follow-up) Update atomic update

Description Alexander Blanchard 2025-04-08 09:35:21 UTC
Some libraries are getting dates of birth from the self-registration form that make patrons impossible ages e.g. year of birth 1900. Add a system preference to allow libraries to add a maximum age when patrons self register so that they receive an error message if their date of birth exceeds this age, prompting them to make a correction.
Comment 1 Alexander Blanchard 2025-04-08 13:11:02 UTC
Created attachment 180718 [details] [review]
Bug 39579: Restrict Patron Self Reg Date of Birth

Some libraries are getting dates of birth from the
self-registration form that make patrons impossible
ages, e.g. year of birth 1900.

To Test:
1) Navigate to the oPac
2) Ensure you are not logged in
3) Below the log in, see 'Create an Account'
4) Click the link and complete the relevant fields
5) Add an unrealistic d.o.b e.g 1900
6) Complete the verification and click 'Submit'
7) Your acount has been created
8) Apply the patch
9) Navigate to the staff site
10) Navigate to Administration > SystemPreferences
11) Navigate to OPAC preferences
12) Identify PatronSelfRegistrationAgeRestriction
13) Add a maximum age in numberals e.g. 100
14) Repeat steps 1 - 6
15) An error message that you have exceeded max age will appear.
16) Alter your date of birth to make your age below that of the max age you set
17) Complete the verification
18) Your account should be created as normal

Sponsored-by: Cheshire
Comment 2 Emmanuel Bétemps 2025-04-14 20:15:35 UTC
Created attachment 180938 [details] [review]
Bug 39579: Restrict Patron Self Reg Date of Birth

Some libraries are getting dates of birth from the
self-registration form that make patrons impossible
ages, e.g. year of birth 1900.

To Test:
1) Navigate to the oPac
2) Ensure you are not logged in
3) Below the log in, see 'Create an Account'
4) Click the link and complete the relevant fields
5) Add an unrealistic d.o.b e.g 1900
6) Complete the verification and click 'Submit'
7) Your acount has been created
8) Apply the patch
9) Navigate to the staff site
10) Navigate to Administration > SystemPreferences
11) Navigate to OPAC preferences
12) Identify PatronSelfRegistrationAgeRestriction
13) Add a maximum age in numberals e.g. 100
14) Repeat steps 1 - 6
15) An error message that you have exceeded max age will appear.
16) Alter your date of birth to make your age below that of the max age you set
17) Complete the verification
18) Your account should be created as normal

Sponsored-by: Cheshire
Signed-off-by: Emmanuel Bétemps <e.betemps@gmail.com>
Comment 3 Emmanuel Bétemps 2025-04-14 20:16:31 UTC
Hi,

I followed the test plan : it works :)

Manu.
Comment 4 Martin Renvoize (ashimema) 2025-04-15 09:07:47 UTC
*** Bug 39481 has been marked as a duplicate of this bug. ***
Comment 5 Lisette Scheer 2025-05-07 20:10:35 UTC
Created attachment 182046 [details] [review]
Bug 39579: Restrict Patron Self Reg Date of Birth

Some libraries are getting dates of birth from the
self-registration form that make patrons impossible
ages, e.g. year of birth 1900.

To Test:
1) Navigate to the OPAC
2) Ensure you are not logged in
3) Below the log in, see 'Create an Account'
4) Click the link and complete the relevant fields
5) Add an unrealistic d.o.b e.g 1900
6) Complete the verification and click 'Submit'
7) Your acount has been created
8) Apply the patch
9) Navigate to the staff site
10) Navigate to Administration > SystemPreferences
11) Navigate to OPAC preferences
12) Identify PatronSelfRegistrationAgeRestriction
13) Add a maximum age in numberals e.g. 100
14) Repeat steps 1 - 6
15) An error message that you have exceeded max age will appear.
16) Alter your date of birth to make your age below that of the max age you set
17) Complete the verification
18) Your account should be created as normal

Sponsored-by: Cheshire
Signed-off-by: Emmanuel Bétemps <e.betemps@gmail.com>
Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Comment 6 Lisette Scheer 2025-05-07 20:10:37 UTC
Created attachment 182047 [details] [review]
Bug 39579: (QA follow-up) Update atomic update

This patch updates the atomic update to fix an error when the database was updated and the permissions for the atomic update file.

Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com>
Comment 7 Katrin Fischer 2025-05-08 06:04:11 UTC
Maybe an idea for a later improvement (separate bug): I wonder if a mininum age would also be useful. Syntax could be similar to CardnumberLength.
Comment 8 Katrin Fischer 2025-05-08 06:51:18 UTC
Pushed for 25.05!

Well done everyone, thank you!