Patron self-registration form accepts date of birth in wrong format

Bug #1361266 reported by Terran McCanna
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Evergreen
Fix Released
Medium
Unassigned
2.7
Fix Released
Medium
Unassigned
2.8
Fix Released
Medium
Unassigned

Bug Description

DOB field on patron self-registration form indicates that DOB should be entered in YYYY-MM-DD format, but it will accept it in other formats. When it is accepted in other formats, it appears on the Pending Patrons table, but does not import into the full user registration form.

Ideally, the patron self-registration form would accept DOB in any common format and swap it to the format it needs upon saving the form. It would also be nice to have a date picker/calendar available for patrons to use. At the very least, it should show an error if the date is entered in the wrong format.

Evergreen 2.5.1
OpenSRF 2.2.1
PostgreSQL 9.1.11
Ubuntu 12.04 LTS

Garry Collum (gcollum)
Changed in evergreen:
status: New → Confirmed
Revision history for this message
Michael Peters (mrpeters) wrote :

Hi Terran,

I've submitted a patch to the working repo at http://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/mrpeters/lp1361266_opac_registration_date_validation to help alleviate some of the annoyance of not having any validation at all on the field.

This adds some simple JavaScript to make sure the input in the stgu.dob text field is in ISO 8601 format upon submitting. If not, the user receives a warning about an invalid date or format and is asked to correct it.

I know this may not be able to be accepted into Evergreen "master" because the popup message is not i18n friendly, but I'm submitting it anyways as lots of implementations are English-speaking organizations and this can benefit them. Hopefully someone can implement a more i18n friendly solution in the future, or maybe even add that date picker, but I wanted to at least resolve the problem you proposed with a little bit of data format validation.

This should cherry-pick cleanly into any version of Evergreen that supports patron self registration (assuming you have enabled the YAOUS to allow it) and is available from http://hostname.tld/eg/opac/register which can be linked from your website or OPAC.

tags: added: pullrequest
tags: added: i18n tpac
Changed in evergreen:
assignee: nobody → Josh Stompro (u-launchpad-stompro-org)
Revision history for this message
Josh Stompro (u-launchpad-stompro-org) wrote :

Hello, I just tested this out and it worked as described.

Tested on SB2, Set the library settings to enable patron self registration and to require DOB and then went to the registration website. The only dates accepted were in the formats listed.

I support getting this added even though it isn't the ultimate perfect solution, it works and does the job. Once we start using it down the road I'll have to evaluate if people get stumped too often by not entering their birthday in the standard weird US format of mm/dd/yyyy.

Joshd

Changed in evergreen:
assignee: Josh Stompro (u-launchpad-stompro-org) → nobody
tags: added: signedoff
Revision history for this message
Terran McCanna (tmccanna) wrote :

Thanks for testing, Josh! We are using this fix in production in PINES and agree that it would be better for Evergreen to accept the dob in any format and translate it to whatever format the database needs, but at least this is a functional workaround for us for the moment.

Terran

Revision history for this message
Josh Stompro (u-launchpad-stompro-org) wrote :

I have tested this code and consent to signing off on it with my name, Josh Stompro and email address, <email address hidden>.

Revision history for this message
Jason Stephenson (jstephenson) wrote :

I added targets on this one, but am leaving it open to see if anyone wants to have some discussion about the i18n of the messages and date formats. This is a place where using a toolkit like Dojo or Angular can really help.

Changed in evergreen:
milestone: none → 2.9-alpha
Changed in evergreen:
importance: Undecided → Medium
Changed in evergreen:
milestone: 2.9-alpha → 2.9-beta
milestone: 2.9-beta → 2.next
milestone: 2.next → 2.7.7
milestone: 2.7.7 → 2.8.3
milestone: 2.8.3 → 2.9-beta
Changed in evergreen:
milestone: 2.9-beta → 2.9.0
Revision history for this message
Josh Stompro (u-launchpad-stompro-org) wrote :

Signoff branch at
user/stompro/lp1361266_opac_registration_date_validation_signoff

Revision history for this message
Jason Stephenson (jstephenson) wrote :

Pushed to master, rel_2_7, and rel_2_8.

Thanks, everyone!

Changed in evergreen:
status: Confirmed → Fix Committed
Changed in evergreen:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.