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

Evergreen Git git at git.evergreen-ils.org
Tue Aug 23 14:18:03 EDT 2011


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  e73ac7870b2f3eb7df696474a4b8cf4c6e8bdea2 (commit)
      from  1bf028d6ee6c2ee620c7b56f6d9d5f5ac7631456 (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 e73ac7870b2f3eb7df696474a4b8cf4c6e8bdea2
Author: Thomas Berezansky <tsbere at mvlc.org>
Date:   Fri Aug 19 09:46:40 2011 -0400

    Fix "Retarget Local Holds" for non-holdable copies
    
    Specificially:
    
    Wrap holdable check in is_true
    Add check for current copy status holdable
    Add check for current copy location holdable
    
    The latter stores the fetched location for later use.
    The one later use I found updated to check if the location is a reference.
    
    The update copy code already checks if location is a reference and deals
    with it properly.
    
    Signed-off-by: Thomas Berezansky <tsbere at mvlc.org>
    Signed-off-by: Mike Rylander <mrylander at gmail.com>

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 f5a7479..270f7aa 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm
@@ -2307,12 +2307,17 @@ sub checkin_retarget {
     return if $self->capture eq 'nocapture'; # Not capturing holds anyway? Move on.
     return if $self->is_precat; # No holds for precats
     return unless $self->circ_lib == $self->copy->circ_lib; # Item isn't "home"? Don't check.
-    return unless $self->copy->holdable; # Not holdable, shouldn't capture holds.
+    return unless $U->is_true($self->copy->holdable); # Not holdable, shouldn't capture holds.
+    my $status = $U->copy_status($self->copy->status);
+    return unless $U->is_true($status->holdable); # Current status not holdable means no hold will ever target the item
     # Specifically target items that are likely new (by status ID)
-    unless ($self->retarget_mode =~ m/\.all/) {
-        my $status = $U->copy_status($self->copy->status)->id;
-        return unless $status == OILS_COPY_STATUS_IN_PROCESS;
+    return unless $status->id == OILS_COPY_STATUS_IN_PROCESS || $self->retarget_mode =~ m/\.all/;
+    my $location = $self->copy->location;
+    if(!ref($location)) {
+        $location = $self->editor->retrieve_asset_copy_location($self->copy->location);
+        $self->copy->location($location);
     }
+    return unless $U->is_true($location->holdable); # Don't bother on non-holdable locations
 
     # Fetch holds for the bib
     my ($result) = $holdcode->method_lookup('open-ils.circ.holds.retrieve_all_from_title')->run(
@@ -2812,7 +2817,11 @@ sub attempt_checkin_hold_capture {
 
     if($self->capture ne 'capture') {
         # see if this item is in a hold-capture-delay location
-        my $location = $self->editor->retrieve_asset_copy_location($self->copy->location);
+        my $location = $self->copy->location;
+        if(!ref($location)) {
+            $location = $self->editor->retrieve_asset_copy_location($self->copy->location);
+            $self->copy->location($location);
+        }
         if($U->is_true($location->hold_verify)) {
             $self->bail_on_events(
                 OpenILS::Event->new('HOLD_CAPTURE_DELAYED', copy_location => $location));

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

Summary of changes:
 .../lib/OpenILS/Application/Circ/Circulate.pm      |   19 ++++++++++++++-----
 1 files changed, 14 insertions(+), 5 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list