[open-ils-commits] [GIT] Evergreen ILS branch master updated. c22cd51ceae8683c31ad2fea7b2388a1c9262dfa

Evergreen Git git at git.evergreen-ils.org
Tue Aug 18 22:40:01 EDT 2015


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, master has been updated
       via  c22cd51ceae8683c31ad2fea7b2388a1c9262dfa (commit)
       via  dd8f8d5ed3df72b6e7e55ed5d81fb18eef7f13bf (commit)
      from  7a0ecf9ae87077e0f4dd0719e0a751428707101a (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit c22cd51ceae8683c31ad2fea7b2388a1c9262dfa
Author: Bill Erickson <berickxx at gmail.com>
Date:   Wed Aug 5 17:41:51 2015 -0400

    LP#1481036 Ignore future backdates live test
    
    Signed-off-by: Bill Erickson <berickxx at gmail.com>
    Signed-off-by: Ben Shum <bshum at biblio.org>

diff --git a/Open-ILS/src/perlmods/live_t/10-lp1481036-future-backdate.t b/Open-ILS/src/perlmods/live_t/10-lp1481036-future-backdate.t
new file mode 100644
index 0000000..a249093
--- /dev/null
+++ b/Open-ILS/src/perlmods/live_t/10-lp1481036-future-backdate.t
@@ -0,0 +1,36 @@
+#!perl
+use strict; use warnings;
+
+use Test::More tests => 3;
+
+diag("Tests handling of future backdates in checkin");
+
+use constant ITEM_BARCODE => 'CONC4000070';
+
+use DateTime;
+use OpenILS::Utils::TestUtils;
+my $script = OpenILS::Utils::TestUtils->new();
+$script->bootstrap;
+
+$script->authenticate({
+    username => 'admin',
+    password => 'demo123',
+    type => 'staff'
+});
+
+ok($script->authtoken, 'Have an authtoken');
+
+my $checkin_resp = $script->do_checkin({
+    barcode => ITEM_BARCODE,
+    backdate => '3001-01-23' # date of the singularity; it is known.
+});
+
+is(ref $checkin_resp,'HASH','Checkin request returned a HASH');
+
+my $ymd = DateTime->now->strftime('%F');
+
+ok(
+    substr($checkin_resp->{payload}->{circ}->checkin_time, 0, 10) eq $ymd,
+    'Checkin time matches current date, not backdate'
+);
+

commit dd8f8d5ed3df72b6e7e55ed5d81fb18eef7f13bf
Author: Bill Erickson <berickxx at gmail.com>
Date:   Mon Aug 3 14:03:52 2015 -0400

    LP#1481036 Ignore future backdates (part 2).
    
    Ensure that future backdates are successully ignored in the checkin API.
    The logic was in place to do this, but it failed to clear the values,
    resulting in using the future backdate anyway.
    
    Signed-off-by: Bill Erickson <berickxx at gmail.com>
    Signed-off-by: Ben Shum <bshum at biblio.org>

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 f4b7503..9bf33a9 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm
@@ -3463,12 +3463,14 @@ sub checkin_handle_backdate {
     $new_date->set_minute($original_date->minute());
     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;
+        # $self->backdate() autoload handler ignores undef values.  
+        # Clear the backdate manually.
+        $logger->info("circulator: ignoring future backdate: $new_date");
+        delete $self->{backdate};
     } else {
-        $bd = cleanse_ISO8601($new_date->datetime());
+        $self->backdate(cleanse_ISO8601($new_date->datetime()));
     }
 
-    $self->backdate($bd);
     return undef;
 }
 

-----------------------------------------------------------------------

Summary of changes:
 .../lib/OpenILS/Application/Circ/Circulate.pm      |    8 +++--
 .../perlmods/live_t/10-lp1481036-future-backdate.t |   36 ++++++++++++++++++++
 2 files changed, 41 insertions(+), 3 deletions(-)
 create mode 100644 Open-ILS/src/perlmods/live_t/10-lp1481036-future-backdate.t


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list