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 <jstephenson@mvlc.org>
$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();
+ }
}
}