[open-ils-commits] [GIT] Evergreen ILS branch rel_2_0 updated. eb1df70a651b0de65ed3d2bd76b29958b47d6262
Evergreen Git
git at git.evergreen-ils.org
Tue Feb 21 10:43:34 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_0 has been updated
via eb1df70a651b0de65ed3d2bd76b29958b47d6262 (commit)
from 4702fc69f66f941ff65c3d11032be145f9c51b9b (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 eb1df70a651b0de65ed3d2bd76b29958b47d6262
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/OpenILS/Application/Storage/Publisher/action.pm b/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm
index d63100c..f306cf9 100644
--- a/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm
+++ b/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm
@@ -1155,30 +1155,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