[open-ils-commits] [GIT] Evergreen ILS branch rel_2_1 updated. 8cfa6fff805686e4f998d85a335b23562c2a9a8e

Evergreen Git git at git.evergreen-ils.org
Tue Feb 21 10:42:59 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, rel_2_1 has been updated
       via  8cfa6fff805686e4f998d85a335b23562c2a9a8e (commit)
      from  bd1e1adb4c60f518dac9f248d9eb477d68cced8b (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 8cfa6fff805686e4f998d85a335b23562c2a9a8e
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 cf9e03e..e4d7354 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
@@ -1159,30 +1159,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