This patch fixes a problem where if a hold meets the following
criteria, an "Invalid date format: at /usr/share/perl5/Error.pm"
error can be thrown when fetching its details:
- the hold has a captured item
- the captured item has status 8 (on hold shelf)
- there is another item that is currently in transit to fill the hold
- the pickup library (or one of its ancestors) has the
circ.hold_shelf_status_delay library setting set.
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Ben Shum <bshum@biblio.org>
# the interval is greater than now, consider the hold to be in the virtual
# "on its way to the holds shelf" status. Return 5.
- my $transit = $e->search_action_hold_transit_copy({hold => $hold->id})->[0];
+ my $transit = $e->search_action_hold_transit_copy({
+ hold => $hold->id,
+ target_copy => $copy->id,
+ dest_recv_time => {'!=' => undef},
+ })->[0];
my $start_time = ($transit) ? $transit->dest_recv_time : $hold->capture_time;
$start_time = DateTime::Format::ISO8601->new->parse_datetime(cleanse_ISO8601($start_time));
my $end_time = $start_time->add(seconds => OpenSRF::Utils::interval_to_seconds($hs_wait_interval));