[open-ils-commits] [GIT] Evergreen ILS branch rel_2_7 updated. f6a60e9c4d2c9512a7c93c6f6ab1ae6590a63931

Evergreen Git git at git.evergreen-ils.org
Tue Aug 18 22:40:02 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, rel_2_7 has been updated
       via  f6a60e9c4d2c9512a7c93c6f6ab1ae6590a63931 (commit)
       via  fe2947c4b6e6e29dade91de63da2976bf4260326 (commit)
      from  fc48994d3a0afb7ff92db55c0e6ec0d29a93a797 (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 f6a60e9c4d2c9512a7c93c6f6ab1ae6590a63931
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 fe2947c4b6e6e29dade91de63da2976bf4260326
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 3bb329d..e910c70 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm
@@ -3645,12 +3645,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