Bug 33105: Redirect to 404 if no vendor exists

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Jonathan Druart 2023-07-07 10:03:36 +02:00 committed by Tomas Cohen Arazi
parent 2f5883c997
commit 6a55fad7b4
Signed by: tomascohen
GPG key ID: 0A272EA1B2F3C15F
2 changed files with 7 additions and 1 deletions

View file

@ -48,6 +48,11 @@ if ( $issue_id ) {
}
my $vendor = Koha::Acquisition::Booksellers->find($booksellerid);
unless ( $vendor ) {
print $input->redirect("/cgi-bin/koha/errors/404.pl");
exit;
}
if ( $op eq 'add_form' || $op eq 'show' ) {
$template->param( issue => $issue );
} elsif ( $op eq 'add_validate' ) {

View file

@ -137,7 +137,8 @@
<input type="hidden" name="issue_id" value="[% issue.issue_id | html %]" />
<button type="submit" class="approve"><i class="fa fa-fw fa-check"></i> Yes, delete</button>
</form>
<form action="/cgi-bin/koha/acqui/vendor_issues.pl?booksellerid=[% vendor.id | uri %]" method="get">
<form action="/cgi-bin/koha/acqui/vendor_issues.pl" method="get">
<input type="hidden" name="booksellerid" value="[% vendor.id | html %]" />
<button type="submit" class="deny"><i class="fa fa-fw fa-remove"></i> No, do not delete</button>
</form>
</div>