Assume that future checkins are junk input
authorThomas Berezansky <tsbere@mvlc.org>
Thu, 21 Jun 2012 15:38:39 +0000 (11:38 -0400)
committerBen Shum <bshum@biblio.org>
Sat, 15 Feb 2014 00:27:14 +0000 (19:27 -0500)
This can happen with SIP2 clients with badly set clocks.

Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
Signed-off-by: Ben Shum <bshum@biblio.org>
Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm

index b390688..5f73860 100644 (file)
@@ -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;