# the user. We'll need to search for copy (or force) holds, a
# volume hold, or a title hold.
$hold = $self->_hold_search($user, $copy_details);
- if (ref($hold) eq 'NCIP::Problem') {
- $response->problem($hold);
- } elsif ($hold->transit()) {
+ if ($hold && $hold->transit()) {
$response->problem(
NCIP::Problem->new(
{
}
)
)
- } else {
+ } elsif ($hold) {
$self->cancel_hold($hold);
$response->data(
{
)
}
)
+ } else {
+ $response->problem(
+ NCIP::Problem->new(
+ {
+ ProblemType => 'Unknown Request',
+ ProblemDetail => 'No request found for the item and user',
+ ProblemElement => 'NULL',
+ ProblemValue => 'NULL'
+ }
+ )
+ )
}
}
}
my $hold;
- # Retrieve all of the user's uncanceled, unfulfilled holds, and
- # then search them in Perl.
+ # Retrieve all of the user's active holds, and then search them in Perl.
my $holds_list = $U->simplereq(
'open-ils.circ',
'open-ils.circ.holds.retrieve',
}
}
- unless ($hold) {
- $hold = NCIP::Problem->new(
- {
- ProblemType => 'Unknown Request',
- ProblemDetail => 'Request matching the user and item not found.',
- ProblemElement => 'NULL',
- ProblemValue => 'NULL'
- }
- )
- }
-
return $hold;
}