From 9a1797691b70678fecab49de3aa8e0503bf41a7d Mon Sep 17 00:00:00 2001 From: Jason Stephenson Date: Thu, 22 Oct 2015 09:13:39 -0400 Subject: [PATCH] Fix bug with title hold in NCIP::ILS::Evergreen->place_hold. Add the selection_ou and selection depth to the parameters when checking if the title hold is possible. This will prevent the placement of holds that are basically unfillable. TODO: There is quite a bit of code here that could be simplified by using test and create instead of separate is possible and create calls. Signed-off-by: Jason Stephenson --- lib/NCIP/ILS/Evergreen.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/NCIP/ILS/Evergreen.pm b/lib/NCIP/ILS/Evergreen.pm index 258d6b8..11f2488 100644 --- a/lib/NCIP/ILS/Evergreen.pm +++ b/lib/NCIP/ILS/Evergreen.pm @@ -2329,7 +2329,11 @@ sub place_hold { $params->{titleid} = $item->id(); if ($org_unit && ref($org_unit) eq 'Fieldmapper::actor::org_unit') { $hold->selection_ou($org_unit->id()); - $hold->selection_depth($org_unit->ou_type->depth()) if (ref($org_unit->ou_type())); + $params->{selection_ou} = $org_unit->id(); + if (ref($org_unit->ou_type())) { + $hold->selection_depth($org_unit->ou_type->depth()); + $params->{depth} = $org_unit->ou_type->depth(); + } } } -- 2.43.2