From 3e9885804533b9cfea07efd0eee0ec9f889e8b37 Mon Sep 17 00:00:00 2001 From: Jason Stephenson Date: Fri, 15 Dec 2017 11:21:43 -0500 Subject: [PATCH] Lp 1661688: Fix undefined value error in Circulate.pm. We needed to check that there was a hold before picking out the hold usr. Also, fix an error in the flesh code added by this branch. We don't need to flesh text fields from actor.usr. Signed-off-by: Jason Stephenson Signed-off-by: Dan Pearl Signed-off-by: Kathy Lussier Signed-off-by: Galen Charlton --- .../lib/OpenILS/Application/Circ/Circulate.pm | 29 +++++++++++----------- 1 file changed, 14 insertions(+), 15 deletions(-) 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 f516381930..caed8bb7e4 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm @@ -1120,10 +1120,8 @@ sub check_captured_holds { fulfillment_time => undef }, { limit => 1, - flesh => 2, - flesh_fields => { ahr => ['usr'], - au => ['family_name', 'first_given_name'] - } + flesh => 1, + flesh_fields => { ahr => ['usr'] } } ] )->[0]; @@ -1131,21 +1129,22 @@ sub check_captured_holds { if ($hold and $hold->usr == $patron->id) { $self->checkout_is_for_hold(1); return undef; + } elsif ($hold) { + my $payload; + my $holdau = $hold->usr; + + if ($holdau) { + $payload->{patron_name} = $holdau->first_given_name . ' ' . $holdau->family_name; + } else { + $payload->{patron_name} = "???"; + } + $payload->{hold_id} = $hold->id; + $self->push_events(OpenILS::Event->new('ITEM_ON_HOLDS_SHELF', + payload => $payload)); } $logger->info("circulator: this copy is needed by a different patron to fulfill a hold"); - my $payload; - my $holdau = $hold->usr; - - if ($holdau) { - $payload->{patron_name} = $holdau->first_given_name . ' ' . $holdau->family_name; - } else { - $payload->{patron_name} = "???"; - } - $payload->{hold_id} = $hold->id; - $self->push_events(OpenILS::Event->new('ITEM_ON_HOLDS_SHELF', - payload => $payload)); } -- 2.11.0