[Bug 13011] New: Parsing a date on sending a letter generates a warning
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13011 Bug ID: 13011 Summary: Parsing a date on sending a letter generates a warning Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: gmcharlt@gmail.com Reporter: jonathan.druart@biblibre.com QA Contact: testopia@bugs.koha-community.org 0000-00-00 seems to be a date but an error occurs on generating it (The 'month' parameter ("0") to DateTime::new did not pass the 'an integer between 1 and 12' callback at /usr/lib/i386-linux-gnu/perl5/5.20/DateTime.pm line 195. DateTime::new(undef, "month", 0, "day", 01, "year", 1900, "time_zone", "Europe/Paris", ...) called at /usr/share/perl5/DateTime/Format/DateParse.pm line 60 DateTime::Format::DateParse::parse_datetime("DateTime::Format::DateParse", "0000/01/00", "Europe/Paris") called at Koha/DateUtils.pm line 87 Koha::DateUtils::dt_from_string("0000-00-00") called at C4/Letters.pm line 639 eval {...} called at C4/Letters.pm line 638 C4::Letters::_parseletter(HASH(0xbf97e78), "suggestions", HASH(0xbf8e39c)) called at C4/Letters.pm line 550 C4::Letters::_substitute_tables(HASH(0xbf97e78), HASH(0xbf8c0b4)) called at C4/Letters.pm line 497 C4::Letters::GetPreparedLetter("module", "suggestions", "letter_code", "CHECKED", "branchcode", undef, "tables", HASH(0xbf8c0b4)) called at C4/Suggestions.pm line 454 C4::Suggestions::ModSuggestion(HASH(0xbf9ac58)) called at t/db_dependent/Suggestions.t line 119 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13011 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED Depends on| |11244 Assignee|gmcharlt@gmail.com |jonathan.druart@biblibre.co | |m --- Comment #1 from Jonathan Druart <jonathan.druart@biblibre.com> --- Introduced by bug 11244. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13011 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff Patch complexity|--- |Trivial patch -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13011 --- Comment #2 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 31938 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=31938&action=edit Bug 13011: 0000-00-00 should not be considered as a valid date When parsing the letter content, the 0000-00-00 should not be replaced, it's not a valid date. Test plan: prove t/db_dependent/Suggestions.t should not return the following error: 0000-00-00 seems to be a date but an error occurs on generating it (The 'month' parameter ("0") to DateTime::new did not pass the 'an integer between 1 and 12' callback -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13011 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13011 Chris Cormack <chris@bigballofwax.co.nz> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #31938|0 |1 is obsolete| | --- Comment #3 from Chris Cormack <chris@bigballofwax.co.nz> --- Created attachment 32321 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=32321&action=edit Bug 13011: 0000-00-00 should not be considered as a valid date When parsing the letter content, the 0000-00-00 should not be replaced, it's not a valid date. Test plan: prove t/db_dependent/Suggestions.t should not return the following error: 0000-00-00 seems to be a date but an error occurs on generating it (The 'month' parameter ("0") to DateTime::new did not pass the 'an integer between 1 and 12' callback Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13011 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13011 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #32321|0 |1 is obsolete| | --- Comment #4 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- Created attachment 32328 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=32328&action=edit [PASSED QA] Bug 13011: 0000-00-00 should not be considered as a valid date When parsing the letter content, the 0000-00-00 should not be replaced, it's not a valid date. Test plan: prove t/db_dependent/Suggestions.t should not return the following error: 0000-00-00 seems to be a date but an error occurs on generating it (The 'month' parameter ("0") to DateTime::new did not pass the 'an integer between 1 and 12' callback Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> Adds another check for 0000-00-00. Passes tests and QA script. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13011 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master CC| |tomascohen@gmail.com --- Comment #5 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Patch pushed to master. Thanks Jonathan! -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org