From: Thomas Berezansky Date: Thu, 21 Jun 2012 15:38:39 +0000 (-0400) Subject: Assume that future checkins are junk input X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=351a8276712ddeb5c6f2d4cec1fe386fd6f5d841;p=evergreen%2Fpines.git Assume that future checkins are junk input This can happen with SIP2 clients with badly set clocks. Signed-off-by: Thomas Berezansky Signed-off-by: Ben Shum --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm index b39068891d..5f7386040a 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm @@ -3637,7 +3637,12 @@ sub checkin_handle_backdate { my $new_date = DateTime::Format::ISO8601->new->parse_datetime($bd); $new_date->set_hour($original_date->hour()); $new_date->set_minute($original_date->minute()); - $bd = cleanse_ISO8601($new_date->datetime()); + if ($new_date >= DateTime->now) { + # We can't say that the item will be checked in later...so assume someone's clock is wrong instead. + $bd = undef; + } else { + $bd = cleanse_ISO8601($new_date->datetime()); + } $self->backdate($bd); return undef;