From 4d3cf26d5b863afb8ec8ef7814aa96c2d2cb33c9 Mon Sep 17 00:00:00 2001 From: dbs Date: Mon, 22 Nov 2010 04:46:49 +0000 Subject: [PATCH] The absence of holds-triggered recall rules should not break hold targeting Thanks to Galen Charlton for pointing out that if rules were not set for holds-triggered recalls, then all hold targeting would break because of an assumption the code made that one could invoke the ->{value} member of the OU settings. But of course the return value for an unset OU setting is undef, not an object with an undef ->{value} member. This should unbreak that code path. git-svn-id: svn://svn.open-ils.org/ILS/trunk@18816 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../Application/Storage/Publisher/action.pm | 24 ++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) 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 fa988990f..25f9cd024 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm @@ -1487,27 +1487,35 @@ sub process_recall { my ($actor, $log, $hold, $good_copies) = @_; # Bail early if we don't have required settings to avoid spurious requests - my $recall_threshold = $actor->request( + my ($recall_threshold, $return_interval, $fine_rules); + + my $rv = $actor->request( 'open-ils.actor.ou_setting.ancestor_default', ''.$hold->pickup_lib, 'circ.holds.recall_threshold' - )->gather(1)->{value}; + )->gather(1); - if (!$recall_threshold) { + if (!$rv) { $log->info("Recall threshold was not set; bailing out on hold ".$hold->id." processing."); return; } + $recall_threshold = $rv->{value}; - my $return_interval = $actor->request( + $rv = $actor->request( 'open-ils.actor.ou_setting.ancestor_default', ''.$hold->pickup_lib, 'circ.holds.recall_return_interval' - )->gather(1)->{value}; + )->gather(1); - if (!$return_interval) { + if (!$rv) { $log->info("Recall return interval was not set; bailing out on hold ".$hold->id." processing."); return; } + $return_interval = $rv->{value}; - my $fine_rules = $actor->request( + $rv = $actor->request( 'open-ils.actor.ou_setting.ancestor_default', ''.$hold->pickup_lib, 'circ.holds.recall_fine_rules' - )->gather(1)->{value}; + )->gather(1); + + if ($rv) { + $fine_rules = $rv->{value}; + } $log->info("Recall threshold: $recall_threshold; return interval: $return_interval"); -- 2.11.0