If a hold is placed with an expiration date in the past, the
expire_time of the hold will be reset using the hold expiration
interval settings.
Likewise, if a hold is changed to have an expiration date in the
past, the hold expiration date will be recalculated using the
hold expiration interval settings.
Signed-off-by: Jason Stephenson <jstephenson@mvlc.org>
Signed-off-by: Ben Shum <bshum@biblio.org>
}
}
+ # Check for hold expiration in the past, and set it to empty string.
+ $hold->expire_time(undef) if ($hold->expire_time && $U->datecmp($hold->expire_time) == -1);
+
# set the configured expire time
unless($hold->expire_time) {
$hold->expire_time(calculate_expire_time($recipient->home_ou));
$hold->clear_prev_check_time;
}
+ # If the hold_expire_time is in the past && is not equal to the
+ # original expire_time, then reset the expire time to be in the
+ # future.
+ if ($hold->expire_time && $U->datecmp($hold->expire_time) == -1 && $U->datecmp($hold->expire_time, $orig_hold->expire_time) != 0) {
+ $hold->expire_time(calculate_expire_time($hold->request_lib));
+ }
+
$e->update_action_hold_request($hold) or return $e->die_event;
$e->commit;