From: Bill Erickson Date: Thu, 22 May 2014 18:41:17 +0000 (-0400) Subject: LP#1322303 cleanse backdate for checkin overdue voiding X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=e3e264ad948df150906def7591cf306b899dd871;p=evergreen%2Fpines.git LP#1322303 cleanse backdate for checkin overdue voiding Passing raw backdates, particularly from offline transactions, which have a space between the date and time, to DateTime::Format::ISO8601->parse_datetime results in "Invalid date format:" errors. Pass the date through the cleanse routine first. Signed-off-by: Bill Erickson Signed-off-by: Ben Shum --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/CircCommon.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/CircCommon.pm index 2901ec5ae3..1315a8c6f9 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/CircCommon.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/CircCommon.pm @@ -44,7 +44,7 @@ sub void_overdues { $duration =~ s/(\d{2}):(\d{2}):(\d{2})/$1 h $2 m $3 s/o; my $interval = OpenSRF::Utils->interval_to_seconds($duration); - my $date = DateTime::Format::ISO8601->parse_datetime($backdate); + my $date = DateTime::Format::ISO8601->parse_datetime(cleanse_ISO8601($backdate)); my $due_date = DateTime::Format::ISO8601->parse_datetime(cleanse_ISO8601($circ->due_date))->epoch; my $grace_period = extend_grace_period( $class, $circ->circ_lib, $circ->due_date, OpenSRF::Utils->interval_to_seconds($circ->grace_period), $e); if($date->epoch <= $due_date + $grace_period) {