Bug 26211 - Patron age verification while doing the self-registration
Summary: Patron age verification while doing the self-registration
Status: Pushed to main
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Lucas Gass (lukeg)
QA Contact: Katrin Fischer
URL:
Keywords:
: 21602 (view as bug list)
Depends on:
Blocks:
 
Reported: 2020-08-14 12:56 UTC by Amit Gupta
Modified: 2025-01-10 02:50 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
This enhancement adds age verification checking to the self-registration and personal details forms. A message is now shown if the date of birth entered doesn't match with the patron category age range, "Patron's age is incorrect for their category. Please try again.".
Version(s) released in:
25.05.00
Circulation function:


Attachments
Bug 26211-Patron age checking while doing the membership registration through OPAC (2.98 KB, patch)
2020-08-14 14:10 UTC, Amit Gupta
Details | Diff | Splinter Review
Bug 26211 - Patron age verification while doing the self-registration. (2.96 KB, patch)
2020-08-14 16:51 UTC, Amit Gupta
Details | Diff | Splinter Review
Bug 26211: (follow-up) Remove age_low and age_high template variables (1.90 KB, patch)
2024-12-10 23:28 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 26211: (follow-up) Remove age_low and age_high template variables (1.96 KB, patch)
2024-12-16 23:53 UTC, Biblibre Sandboxes
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Amit Gupta 2020-08-14 12:56:46 UTC
Currently we are not checking patron age while doing the membership registration from the OPAC.

We are checking patron age while doing registration through Staff page.
for ex: "The following fields are wrong. Please fix them. Patron's age is incorrect for their category. Ages allowed are 5-17."
Comment 1 Amit Gupta 2020-08-14 14:10:09 UTC Comment hidden (obsolete)
Comment 2 Katrin Fischer 2020-08-14 14:17:48 UTC
Looks good on first glance! Commit message needs a little fix - 
Bug 26211: Patron ...
Comment 3 Amit Gupta 2020-08-14 16:47:09 UTC
(In reply to Katrin Fischer from comment #2)
> Looks good on first glance! Commit message needs a little fix - 
> Bug 26211: Patron ...
Comment 4 Amit Gupta 2020-08-14 16:48:13 UTC
(In reply to Katrin Fischer from comment #2)
> Looks good on first glance! Commit message needs a little fix - 
> Bug 26211: Patron ...

I think below message looks OK.

"Patron age verification while doing the self-registration"
Comment 5 Amit Gupta 2020-08-14 16:51:41 UTC
Created attachment 108303 [details] [review]
Bug 26211 - Patron age verification while doing the  self-registration.

Modify Commit message -> "Patron age versification while doing the self-registration"

To Test
1. Create the patron category from the staff page for ex: Kid and give age required and age Upperage limit
   age required 5 yrs and upperage limit 17.
2. Allow category in PatronSelfRegistrationDefaultCategory for online registration from opac.
3. Go to /cgi-bin/koha/opac-memberentry.pl page.
4. Fill the form and give choose date of birth 10/10/1974 and click OK. Now you can able to save the page.
5. Apply the patch.
6. Again go to cgi-bin/koha/opac-memberentry.pl page.
7. Fill the form and give choose date of birth 10/10/1974 and click OK. It will give the error message.
   Patron's age is incorrect for their category. Ages allowed are 5-17.
Comment 6 Katrin Fischer 2020-08-14 16:57:00 UTC
The QA scripts complain if the commit message doesn't start with Bug xxxx: - that was what I meant, but I was not clear about it.
Comment 7 Owen Leonard 2020-08-14 16:59:10 UTC
I'm getting some errors from this. If I have the patron category field exposed in the patron self-registration form I get this error when submitting the form with an invalid date of birth:

Can't call method "param" on an undefined value at /kohadevbox/koha/opac/opac-memberentry.pl line 485

If I hide the patron category field and submit the form with a valid or invalid date of birth I get this error:

Can't call method "dateofbirthrequired" on an undefined value at /kohadevbox/koha/opac/opac-memberentry.pl line 482
Comment 8 Amit Gupta 2020-08-14 17:16:31 UTC
(In reply to Owen Leonard from comment #7)
> I'm getting some errors from this. If I have the patron category field
> exposed in the patron self-registration form I get this error when
> submitting the form with an invalid date of birth:
> 
> Can't call method "param" on an undefined value at
> /kohadevbox/koha/opac/opac-memberentry.pl line 485
> 
> If I hide the patron category field and submit the form with a valid or
> invalid date of birth I get this error:
> 
> Can't call method "dateofbirthrequired" on an undefined value at
> /kohadevbox/koha/opac/opac-memberentry.pl line 482

Thank Owen for giving the feedback.

I am able to reproduce the second issue. 

But with first one I am able to save the form and not find any issue. In case if I am giving the invalid date of birth



(In reply to Owen Leonard from comment #7)
> I'm getting some errors from this. If I have the patron category field
> exposed in the patron self-registration form I get this error when
> submitting the form with an invalid date of birth:
> 
> Can't call method "param" on an undefined value at
> /kohadevbox/koha/opac/opac-memberentry.pl line 485
> 
> If I hide the patron category field and submit the form with a valid or
> invalid date of birth I get this error:
> 
> Can't call method "dateofbirthrequired" on an undefined value at
> /kohadevbox/koha/opac/opac-memberentry.pl line 482

Thank Owen for giving the feedback.

I am able to reproduce the second issue. 

But with first one I am able to save the form and not find any issue. In case if I am giving the invalid date of birth
Comment 9 Amit Gupta 2020-08-14 18:04:23 UTC
I have checked and calendar have some issues. 

While doing the registration from OPAC if we will give any invalid date it is not giving any alert or error message. It's simply saving the record.

I will raise a bug to fix the calendar issue on the OPAC side.
Comment 10 Andrew Fuerste-Henry 2024-11-22 14:17:25 UTC
*** Bug 21602 has been marked as a duplicate of this bug. ***
Comment 11 Lucas Gass (lukeg) 2024-12-09 18:40:08 UTC
Will this get worked on again? Seems like we could easily use is_age_valid here.
Comment 12 Lucas Gass (lukeg) 2024-12-10 23:24:55 UTC
I don't think we should pass along any information about the age requirements for a given patron category. (Ages allowed are [% age_low | html %]-[% age_high | html %].)

It's not a hint to allow the user to adjust their DOB.
Comment 13 Lucas Gass (lukeg) 2024-12-10 23:28:15 UTC
Created attachment 175366 [details] [review]
Bug 26211: (follow-up) Remove age_low and age_high template variables
Comment 14 Biblibre Sandboxes 2024-12-16 23:53:51 UTC
Created attachment 175582 [details] [review]
Bug 26211: (follow-up) Remove age_low and age_high template variables

Signed-off-by: Sam Sowanick <sam.sowanick@corvallisoregon.gov>
Comment 15 Katrin Fischer 2024-12-30 13:15:20 UTC
I have removed the "Please try again." as we also show "Please correct and resubmit" below the errors and it seemed like a bit of a double up.
Comment 16 Katrin Fischer 2024-12-30 13:17:19 UTC
The patron age check is also done when an existing patron updates their address etc. information. You can still leave it empty, if it's not made mandatory.
Comment 17 Katrin Fischer 2024-12-30 14:14:52 UTC
Pushed for 25.05!

Well done everyone, thank you!