Bug 41814 - Limit the maximum age for borrower categories without a specified range
Summary: Limit the maximum age for borrower categories without a specified range
Status: Needs Signoff
Alias: None
Product: Koha
Classification: Unclassified
Component: Patrons (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low enhancement
Assignee: Jake Deery
QA Contact: Testopia
URL:
Keywords:
Depends on: 39579
Blocks:
  Show dependency treegraph
 
Reported: 2026-02-11 09:15 UTC by Jake Deery
Modified: 2026-02-11 15:01 UTC (History)
2 users (show)

See Also:
GIT URL:
Initiative type: ---
Sponsorship status: ---
Comma delimited list of Sponsors:
Crowdfunding goal: 0
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 41814: Add PatronAgeRestriction syspref and code (14.39 KB, patch)
2026-02-11 09:55 UTC, Jake Deery
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jake Deery 2026-02-11 09:15:43 UTC
We should be able to optionally set a maximum age for any borrower categories that don't already have a specified range.

This is already possible on the OPAC with PatronSelfRegistrationAgeRange, I propose a PatronAgeRange that applies to the intranet, as well as the OPAC (if PatronSelfRegistrationAgeRange is not set).
Comment 1 Jake Deery 2026-02-11 09:55:24 UTC
Created attachment 192969 [details] [review]
Bug 41814: Add PatronAgeRestriction syspref and code

This patch adds a new PatronAgeRestriction, which acts in the same way PatronSelfRegistrationAgeRestriction (a restriction on the maximum age of a borrower), except for the intranet. It will also act as the maximum age restrictor on the OPAC, in the event that the PatronSelfRegistrationAgeRestriction is not set.

To test:
== APPLY PATCH ==
a)  updatedatabase
b)  Set the PatronAgeRestriction syspref to 20, set the PatronSelfRegistrationAgeRestriction to 30
c)  On the OPAC, try to create or modify a patron whose age is 35 years
    *)  Note the error message presented, suggesting the age exceeds the maximum
d)  On the OPAC, try to create or modify a patron whose age is 25 years
    *)  Note the submission succeeds
e)  On the staff client, try to create or modify a patron whose age is 25 years
    *)  Note the error message presented, suggesting the age exceeds the maximum
f)  Set the PatronSelfRegistrationAgeRestriction to empty
g)  On the OPAC, try to create or modify a patron whose age is 25 years
    *)  Note the error message presented, suggesting the age exceeds the maximum
h)  On the OPAC, try to create or modify a patron whose age is 19 years
    *)  Note the submission succeeds
i)  Set the PatronAgeRestriction to empty
j)  On the staff client, try to create or modify a patron whose age is 75 years
    *)  Note the submission succeeds
k)  On the OPAC, try to create or modify a patron whose age is 75 years
    *)  Note the submission succeeds
== SIGN OFF ==