Bugzilla – Attachment 36284 Details for
Bug 11120
The date option for the overdue_notices cronjob is broken
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 11120: the date input should be in a iso format (YYYY-MM-DD)
Bug-11120-the-date-input-should-be-in-a-iso-format.patch (text/plain), 1.28 KB, created by
Brendan Gallagher
on 2015-03-02 11:40:44 UTC
(
hide
)
Description:
Bug 11120: the date input should be in a iso format (YYYY-MM-DD)
Filename:
MIME Type:
Creator:
Brendan Gallagher
Created:
2015-03-02 11:40:44 UTC
Size:
1.28 KB
patch
obsolete
>From e8730188ce4c2ec5b45f9e5684d1597b308c29e7 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Tue, 6 Jan 2015 14:27:17 +0100 >Subject: [PATCH] Bug 11120: the date input should be in a iso format > (YYYY-MM-DD) > >Note that it cans also accept a date in the same format defined in the >dateformat system preference. > >Signed-off-by: Brendan Gallagher <brendan@bywatersolutions.com> >--- > misc/cronjobs/overdue_notices.pl | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > >diff --git a/misc/cronjobs/overdue_notices.pl b/misc/cronjobs/overdue_notices.pl >index c9c2d69..e46b3f0 100755 >--- a/misc/cronjobs/overdue_notices.pl >+++ b/misc/cronjobs/overdue_notices.pl >@@ -360,13 +360,15 @@ if (@branchcodes) { > my $date_to_run; > my $date; > if ( $date_input ){ >- $date = $dbh->quote($date); > eval { >- $date_to_run = dt_from_string( $date_input ); >+ $date_to_run = dt_from_string( $date_input, 'iso' ); > }; > die "$date_input is not a valid date, aborting! Use a date in format YYYY-MM-DD." > if $@ or not $date_to_run; > >+ # It's certainly useless to escape $date_input >+ # dt_from_string should not return something if $date_input is not correctly set. >+ $date = $dbh->quote( $date_input ); > } > else { > $date="NOW()"; >-- >1.7.10.4
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 11120
:
22304
|
29465
|
33929
|
34952
|
34953
|
34962
|
34963
|
34979
|
34980
|
34981
|
36282
|
36283
| 36284