Bug 22068: (QA follow-up) Return meaningful error codes

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit e98dacf9f1)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(cherry picked from commit 912a97f8b4)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Tomas Cohen Arazi 2019-04-05 15:13:36 -03:00 committed by Lucas Gass
parent 96a700c3dd
commit 147d67cebf
1 changed files with 5 additions and 1 deletions

View File

@ -41,10 +41,14 @@ my $id = $query->param('id');
if ( $id ) {
my $ar = Koha::ArticleRequests->find( $id );
if ( !$ar || $ar->borrowernumber != $borrowernumber ) {
if ( !$ar ) {
print $query->redirect("/cgi-bin/koha/errors/404.pl");
exit;
}
elsif ( $ar->borrowernumber != $borrowernumber ) {
print $query->redirect("/cgi-bin/koha/errors/403.pl");
exit;
}
$ar->cancel();
}