From: miker Date: Sat, 30 Dec 2006 17:05:04 +0000 (+0000) Subject: ignoring deleted copies during initial search X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=950594676e443519e0bb208ce2bf56eefb796b2b;p=Evergreen.git ignoring deleted copies during initial search git-svn-id: svn://svn.open-ils.org/ILS/branches/rel_1_0@6711 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm b/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm index 7944f7f23e..0ebb08d3be 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm @@ -784,7 +784,10 @@ sub new_hold_copy_targeter { for my $cn ( @{ $rtree->call_numbers } ) { push @$all_copies, - asset::copy->search( id => [map {$_->id} @{ $cn->copies }] ); + asset::copy->search_where( + { id => [map {$_->id} @{ $cn->copies }], + deleted => 'f' } + ); } } } elsif ($hold->hold_type eq 'T') { @@ -799,7 +802,10 @@ sub new_hold_copy_targeter { for my $cn ( @{ $rtree->call_numbers } ) { push @$all_copies, - asset::copy->search( id => [map {$_->id} @{ $cn->copies }] ); + asset::copy->search_where( + { id => [map {$_->id} @{ $cn->copies }], + deleted => 'f' } + ); } } elsif ($hold->hold_type eq 'V') { my ($vtree) = $self @@ -807,10 +813,12 @@ sub new_hold_copy_targeter { ->run( $hold->target, $hold->selection_ou, $hold->selection_depth ); push @$all_copies, - asset::copy->search( id => [map {$_->id} @{ $vtree->copies }] ); + asset::copy->search_where( + { id => [map {$_->id} @{ $vtree->copies }], + deleted => 'f' } + ); - } elsif ($hold->hold_type eq 'C') { - + } elsif ($hold->hold_type eq 'C' || $hold->hold_type eq 'R' || $hold->hold_type eq 'F') { $all_copies = [asset::copy->retrieve($hold->target)]; } @@ -845,10 +853,10 @@ sub new_hold_copy_targeter { my @good_copies; for my $c (@$all_copies) { # current target - next if ($c->id == $hold->current_copy); + next if ($c->id eq $hold->current_copy); # circ lib is closed - next if ( grep { ''.$_->org_unit == ''.$c->circ_lib } @closed ); + next if ( grep { ''.$_->org_unit eq ''.$c->circ_lib } @closed ); # target of another hold next if (action::hold_request