[open-ils-commits] r18816 - trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher (dbs)
svn at svn.open-ils.org
svn at svn.open-ils.org
Sun Nov 21 23:46:52 EST 2010
Author: dbs
Date: 2010-11-21 23:46:49 -0500 (Sun, 21 Nov 2010)
New Revision: 18816
Modified:
trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm
Log:
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.
Modified: trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm
===================================================================
--- trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm 2010-11-22 04:26:44 UTC (rev 18815)
+++ trunk/Open-ILS/src/perlmods/OpenILS/Application/Storage/Publisher/action.pm 2010-11-22 04:46:49 UTC (rev 18816)
@@ -1487,28 +1487,36 @@
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");
# We want checked out copies (status = 1) at the hold pickup lib
More information about the open-ils-commits
mailing list