Summary: | Date of birth entered without correct format causes internal server error | ||
---|---|---|---|
Product: | Koha | Reporter: | Donna <bwsdonna> |
Component: | Patrons | Assignee: | Nick Clemens (kidclamp) <nick> |
Status: | CLOSED FIXED | QA Contact: | Joonas Kylmälä <joonas.kylmala> |
Severity: | normal | ||
Priority: | P5 - low | CC: | andrew, danieldaba, fridolin.somers, gmcharlt, jonathan.druart, joonas.kylmala, kelly, kyle.m.hall, lucas, margaret, nick, victor |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
See Also: | https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22805 | ||
Change sponsored?: | --- | Patch complexity: | --- |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: |
21.05.00,20.11.05,20.05.11
|
|
Circulation function: | |||
Bug Depends on: | |||
Bug Blocks: | 28538 | ||
Attachments: |
Bug 27937: Unit test
Bug 23937: Allow for single date day or month Bug 27937: Set datepicker when date is valid Bug 27937: Set datepicker when date is valid Bug 27937: Set datepicker when date is valid Bug 27937: (QA follow-up) Fix indentation Bug 27937: Set datepicker when date is valid |
Description
Donna
2021-03-11 20:16:56 UTC
Created attachment 118315 [details] [review] Bug 27937: Unit test Created attachment 118316 [details] [review] Bug 23937: Allow for single date day or month When validating dates in JavaScript it is acceptable to have single digit days or months e.g,: 2011-6-16 When parsing in Koha::DateUtils->dt_from_string we die on these This patch changes the logic to allow for one or two digits in the days and months To test: 1 - Add new patron 2 - Enter birthdate as 2/11/1986 3 - Complete required fields 4 - Save 5 - Get ISE The given date (2/11/1986) does not match the date format (us) at /kohadevbox/koha/Koha/DateUtils.pm line 175 6 - Apply patch 7 - Repeat 1-4 8 - Patron successfully added 9 - Edit patron, try setting DOB to 2/1/1986 10 - Success! 11 - Repeat with other settings of system preference 'dateformat' Another option here would be to validate/normalize the data in the JS before passing to Koha Created attachment 118317 [details] [review] Bug 27937: Set datepicker when date is valid When validating dates in JavaScript it is acceptable to have single digit days or months e.g,: 2011-6-16 When parsing in Koha::DateUtils->dt_from_string we die on these This patch uses JS to set the datepicker which normalizes the date as Koha expects To test: 1 - Add new patron 2 - Enter birthdate as 2/11/1986 3 - Complete required fields 4 - Save 5 - Get ISE The given date (2/11/1986) does not match the date format (us) at /kohadevbox/koha/Koha/DateUtils.pm line 175 6 - Apply patch 7 - Repeat 1-2 8 - Note that when you change focus (click on another field) the date is formatted as '02/11/1986' 9 - Save patron, success! 10 - Edit patron, try setting DOB to 2/1/1986 11 - Change focus and note date is formatted as '02/01/1986', save 12 - Repeat with other settings of system preference 'dateformat' Current status: Needs Signoff Created attachment 118368 [details] [review] Bug 27937: Set datepicker when date is valid When validating dates in JavaScript it is acceptable to have single digit days or months e.g,: 2011-6-16 When parsing in Koha::DateUtils->dt_from_string we die on these This patch uses JS to set the datepicker which normalizes the date as Koha expects To test: 1 - Add new patron 2 - Enter birthdate as 2/11/1986 3 - Complete required fields 4 - Save 5 - Get ISE The given date (2/11/1986) does not match the date format (us) at /kohadevbox/koha/Koha/DateUtils.pm line 175 6 - Apply patch 7 - Repeat 1-2 8 - Note that when you change focus (click on another field) the date is formatted as '02/11/1986' 9 - Save patron, success! 10 - Edit patron, try setting DOB to 2/1/1986 11 - Change focus and note date is formatted as '02/01/1986', save 12 - Repeat with other settings of system preference 'dateformat' Signed-off-by: Donna <donna@bywatersolutions.com> Created attachment 119069 [details] [review] Bug 27937: Set datepicker when date is valid When validating dates in JavaScript it is acceptable to have single digit days or months e.g,: 2011-6-16 When parsing in Koha::DateUtils->dt_from_string we die on these This patch uses JS to set the datepicker which normalizes the date as Koha expects To test: 1 - Add new patron 2 - Enter birthdate as 2/11/1986 3 - Complete required fields 4 - Save 5 - Get ISE The given date (2/11/1986) does not match the date format (us) at /kohadevbox/koha/Koha/DateUtils.pm line 175 6 - Apply patch 7 - Repeat 1-2 8 - Note that when you change focus (click on another field) the date is formatted as '02/11/1986' 9 - Save patron, success! 10 - Edit patron, try setting DOB to 2/1/1986 11 - Change focus and note date is formatted as '02/01/1986', save 12 - Repeat with other settings of system preference 'dateformat' Signed-off-by: Donna <donna@bywatersolutions.com> Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi> Created attachment 119070 [details] [review] Bug 27937: (QA follow-up) Fix indentation Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi> Created attachment 119084 [details] [review] Bug 27937: Set datepicker when date is valid When validating dates in JavaScript it is acceptable to have single digit days or months e.g,: 2011-6-16 When parsing in Koha::DateUtils->dt_from_string we die on these This patch uses JS to set the datepicker which normalizes the date as Koha expects To test: 1 - Add new patron 2 - Enter birthdate as 2/11/1986 3 - Complete required fields 4 - Save 5 - Get ISE The given date (2/11/1986) does not match the date format (us) at /kohadevbox/koha/Koha/DateUtils.pm line 175 6 - Apply patch 7 - Repeat 1-2 8 - Note that when you change focus (click on another field) the date is formatted as '02/11/1986' 9 - Save patron, success! 10 - Edit patron, try setting DOB to 2/1/1986 11 - Change focus and note date is formatted as '02/01/1986', save 12 - Repeat with other settings of system preference 'dateformat' Signed-off-by: Donna <donna@bywatersolutions.com> Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi> Bug 27937: (QA follow-up) Fix indentation Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi> Pushed to master for 21.05, thanks to everybody involved! Pushed to 20.11.x for 20.11.05 Pushed to 20.05.x for 20.05.11 Not backported to oldoldstable (19.11.x). Feel free to ask if it's needed. |