[Bug 22805] New: When borrowers.dateofbirth is set to a date matching '0YYY-MM-DD', memberentry.pl crashes on save.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22805 Bug ID: 22805 Summary: When borrowers.dateofbirth is set to a date matching '0YYY-MM-DD', memberentry.pl crashes on save. Change sponsored?: --- Product: Koha Version: 18.11 Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Patrons Assignee: koha-bugs@lists.koha-community.org Reporter: barton@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com, kyle.m.hall@gmail.com Target Milestone: --- Symptom: Crash on save when in memberentry.pl for a particular patron. Inspecting the plack error logs, I saw The given date (02/26/986) does not match the date format (us) at /usr/share/koha/lib/Koha/DateUtils.pm line 168. To replicate: Edit a patron. Set the first digit in the year of the patron's birthday to 0, e.g for a 'MM/DD/YYYY' formatted date, this would be '02/26/0986' Click save. This causes an Internal Server Error. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22805 Barton Chittenden <barton@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|enhancement |normal -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22805 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@bugs.koha-c | |ommunity.org --- Comment #1 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Do you have a specific use case? :) Koha::DateUtils considers that years are formed by 4 digits, 986 is not correctly parsed. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22805 --- Comment #2 from Barton Chittenden <barton@bywatersolutions.com> --- (In reply to Jonathan Druart from comment #1)
Do you have a specific use case? :)
Koha::DateUtils considers that years are formed by 4 digits, 986 is not correctly parsed.
Jonathan, If you enter the date date of birth as '02/26/0986' *in memberentry.pl* it gets saved as '0986-02-26' in the database. Somewhere in the process of loading that into Koha::DateUtils, the leading 0 is lost, which causes the crash -- '0986' is obviously a typo of '1986', and that's causing the crash. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22805 --- Comment #3 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Here it is not saved, the crash appears at Koha::Patron::get_age('Koha::Patron=HASH(0x55dfa6af0400)') called at /home/vagrant/kohaclone/members/memberentry.pl line 338 before the patron is stored (on line 434). -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22805 Barton Chittenden <barton@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|When borrowers.dateofbirth |memberentry.pl crashes when |is set to a date matching |date of birth year matches |'0YYY-MM-DD', |0YYY. |memberentry.pl crashes on | |save. | -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22805 --- Comment #4 from Barton Chittenden <barton@bywatersolutions.com> --- (In reply to Jonathan Druart from comment #3)
Here it is not saved, the crash appears at Koha::Patron::get_age('Koha::Patron=HASH(0x55dfa6af0400)') called at /home/vagrant/kohaclone/members/memberentry.pl line 338
before the patron is stored (on line 434).
Ok, let's fix that then. I've changed the bug title accordingly. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22805 --- Comment #5 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- If it is not saved it means that comment 1 is valid and, so, what is the use case? :) If it's an typo to handle I'd prefer to fix it client-side (force the date plugin to get a date > 1000, maybe 1900?) and not hack Koha::DateUtils. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22805 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Version|18.11 |master -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22805 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=11220 -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22805 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|memberentry.pl crashes when |Koha::DateUtils does not |date of birth year matches |support dates with three |0YYY. |digit years CC| |nick@bywatersolutions.com -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22805 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=27937 --- Comment #6 from Nick Clemens <nick@bywatersolutions.com> --- While initially filed as affecting patrons over 1000 years old, this bug has implications in other places - In serials (try setting first issue publication date to 01-01-999) - Items can set an acquisition date of 01-01-999 These may be edge cases, but I don't see why we should not support three digit years -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22805 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|NEW |RESOLVED --- Comment #7 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- It looks like this might be resolved with flatpickr. It doesn't let you enter a 3 digit year, it always resets to the current year then. And if you save 0999, the year still displays nicely when the patron is edited. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org