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

Evergreen Git git at git.evergreen-ils.org
Tue Feb 21 10:42:23 EST 2012


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  f27de9486a348bd828d28093640a0da8eee708b8 (commit)
      from  881b4669725e84df992f0ad5ffff82a61ab401e7 (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 f27de9486a348bd828d28093640a0da8eee708b8
Author: Thomas Berezansky <tsbere at mvlc.org>
Date:   Mon Jan 30 13:34:53 2012 -0500

    Stop targeter crash on empty metarecord with holds
    
    By checking for 1 or more records before looking them up.
    
    Signed-off-by: Thomas Berezansky <tsbere at mvlc.org>
    Signed-off-by: Ben Shum <bshum at biblio.org>
    Signed-off-by: Mike Rylander <mrylander at gmail.com>

diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/action.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/action.pm
index 2beaae5..f6a4515 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/action.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Publisher/action.pm
@@ -1151,30 +1151,33 @@ sub new_hold_copy_targeter {
 
 			# find all the potential copies
 			if ($hold->hold_type eq 'M') {
-				for my $r ( map
-						{$_->record}
-						metabib::record_descriptor
-							->search(
-								record => [
-									map {
-										isTrue($_->deleted) ?  () : ($_->id)
-									} metabib::metarecord->retrieve($hold->target)->source_records
-								],
-								( $types   ? (item_type => [split '', $types])   : () ),
-								( $formats ? (item_form => [split '', $formats]) : () ),
-								( $lang	   ? (item_lang => $lang)				 : () ),
-							)
-				) {
-					my ($rtree) = $self
-						->method_lookup( 'open-ils.storage.biblio.record_entry.ranged_tree')
-						->run( $r->id, $hold->selection_ou, $hold->selection_depth );
-
-					for my $cn ( @{ $rtree->call_numbers } ) {
-						push @$all_copies,
-							asset::copy->search_where(
-								{ id => [map {$_->id} @{ $cn->copies }],
-								  deleted => 'f' }
-							) if ($cn && @{ $cn->copies });
+				my $records = [
+					map {
+						isTrue($_->deleted) ?  () : ($_->id)
+					} metabib::metarecord->retrieve($hold->target)->source_records
+				];
+                if(@$records > 0) {
+					for my $r ( map
+							{$_->record}
+							metabib::record_descriptor
+								->search(
+									record => $records,
+									( $types   ? (item_type => [split '', $types])   : () ),
+									( $formats ? (item_form => [split '', $formats]) : () ),
+									( $lang	   ? (item_lang => $lang)				 : () ),
+								)
+					) {
+						my ($rtree) = $self
+							->method_lookup( 'open-ils.storage.biblio.record_entry.ranged_tree')
+							->run( $r->id, $hold->selection_ou, $hold->selection_depth );
+
+						for my $cn ( @{ $rtree->call_numbers } ) {
+							push @$all_copies,
+								asset::copy->search_where(
+									{ id => [map {$_->id} @{ $cn->copies }],
+									  deleted => 'f' }
+								) if ($cn && @{ $cn->copies });
+						}
 					}
 				}
 			} elsif ($hold->hold_type eq 'T') {

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

Summary of changes:
 .../Application/Storage/Publisher/action.pm        |   51 ++++++++++---------
 1 files changed, 27 insertions(+), 24 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list