Bugzilla – Attachment 31938 Details for
Bug 13011
Parsing a date on sending a letter generates a warning
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 13011: 0000-00-00 should not be considered as a valid date
Bug-13011-0000-00-00-should-not-be-considered-as-a.patch (text/plain), 1.48 KB, created by
Jonathan Druart
on 2014-09-30 09:38:44 UTC
(
hide
)
Description:
Bug 13011: 0000-00-00 should not be considered as a valid date
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2014-09-30 09:38:44 UTC
Size:
1.48 KB
patch
obsolete
>From 734953958229df52eb15cbd6d20e6628b4ed15d5 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Tue, 30 Sep 2014 11:36:39 +0200 >Subject: [PATCH] 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 >--- > C4/Letters.pm | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > >diff --git a/C4/Letters.pm b/C4/Letters.pm >index 912294e..cc84619 100644 >--- a/C4/Letters.pm >+++ b/C4/Letters.pm >@@ -632,7 +632,10 @@ sub _parseletter { > > $val = GetAuthorisedValueByCode ('ROADTYPE', $val, 0) if $table=~/^borrowers$/ && $field=~/^streettype$/; > my $replacedby = defined ($val) ? $val : ''; >- if ( $replacedby and $replacedby =~ m|^\d{4}-\d{2}-\d{2}( \d{2}:\d{2}:\d{2})?$| ) { >+ if ( $replacedby >+ and not $replacedby =~ m|0000-00-00| >+ and $replacedby =~ m|^\d{4}-\d{2}-\d{2}( \d{2}:\d{2}:\d{2})?$| ) >+ { > # If the value is XXXX-YY-ZZ[ AA:BB:CC] we assume it is a date > my $dateonly = defined $1 ? 0 : 1; #$1 refers to the capture group wrapped in parentheses. In this case, that's the hours, minutes, seconds. > eval { >-- >2.1.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 13011
:
31938
|
32321
|
32328