Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Asset not found #1

Open
wants to merge 3 commits into
base: aadl
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions iNCIPit.cgi
Original file line number Diff line number Diff line change
Expand Up @@ -511,16 +511,32 @@ sub item_cancelled {
# we are the user agency
$barcode .= $faidValue;
my $copy = copy_from_barcode($barcode);
if (ref($copy) eq "HASH") {
if ($copy->{textcode} eq 'ASSET_COPY_NOT_FOUND') {
staff_log( $taidValue, $faidValue, "Bad Barcode Requested: ". $barcode );
fail("cancel request on non-existent item");
exit;
}
}
fail( $copy->{textcode} . " $barcode" ) unless ( blessed $copy);
my $r = cancel_hold($barcode);
$r = delete_copy($copy);
} else {
# we are the item agency
unless ( $conf->{behavior}->{no_item_agency_holds} =~ m/^y/i ) {
# Make sure the copy exists!
my $copy = copy_from_barcode($barcode);
# If copy does not exist, return failure
if (ref($copy) eq "HASH") {
if ($copy->{textcode} eq 'ASSET_COPY_NOT_FOUND') {
staff_log( $taidValue, $faidValue, "Bad Barcode Requested: ". $barcode );
fail("cancel request on non-existent item");
exit;
}
}
# remove hold!
my $r = cancel_hold($barcode);
# TODO: check for any errors or unexpected return values in $r
my $copy = copy_from_barcode($barcode);

fail( $copy->{textcode} . " $barcode" ) unless ( blessed $copy);
$r = update_copy( $copy, 7 ); # set to reshelving (for wiggle room)
# TODO: check for any errors or unexpected return values in $r
Expand Down