# newest_first => 1
# Target holds in reverse order of create_time.
#
-# retarget_nonviable => 1
-# Only retarget holds holds whose current_copy is no longer viable
-# (e.g. copy was marked as non-circulate) or that have no current_copy
-# set. This setting is ignored if 'hold' or 'retarget_all' are set.
+# skip_viable => 1
+# Avoid retargeting holds whose current_copy is still viable and permitted.
+# This setting can be used in conjunction with any other settings.
#
# target_all => 1
# USE WITH CAUTION. Forces (re)targeting of all active holds. This
for my $hold_id ($self->find_holds_to_target) {
my $single = OpenILS::Utils::HoldTargeter::Single->new(
parent => $self,
- retarget_nonviable => $args{retarget_nonviable}
+ skip_viable => $args{skip_viable}
);
$single->target($hold_id);
push(@responses, $single->result) unless $self->{return_count};
# previous target is no longer valid.
return 1 unless $prev;
- if ($self->{retarget_nonviable}) {
- # In retarget_nonviable mode, leave the hold as-is if
+ if ($self->{skip_viable}) {
+ # In skip_viable mode, leave the hold as-is if
# the existing current_copy is still permitted.
- return $self->exit_targeter(
- "Skipping hold with viable target in 'retarget_nonviable' mode")
+ return $self->exit_targeter("Skipping with viable target = $prev_id")
if $self->copy_is_permitted($prev);
}
$e->commit;
$self->{success} = 1;
- return $self->exit_targeter("Hold successfully targeted");
+ return $self->exit_targeter("successfully targeted copy ".$copy->{id});
}
# Creates a new row in action.unfulfilled_hold_list for our hold.
return unless $self->filter_closed_date_copies;
# Set aside the previously targeted copy for later use as needed.
- # Code may exit here in retarget_nonviable mode if the existing
+ # Code may exit here in skip_viable mode if the existing
# current_copy value is still viable.
return unless $self->inspect_previous_target;
- # Log that the hold was not captured. Logging this here is
- # necessary for max-loops calculation.
+ # Log that the hold was not captured.
return unless $self->log_unfulfilled_hold;
# Confirm again we have something to work on. If we have no