Bug 40929: Add $hold test in opac-modrequest

Test plan:
Login at OPAC.
Pass an unexisting reserve_id in a opac-modrequest.pl URL.
Verify that you get a 403 redirect.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 013a469b45)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
This commit is contained in:
Marcel de Rooy 2025-10-01 16:34:38 +02:00 committed by Paul Derscheid
parent 91a6481ab1
commit 79c93d7a3d
No known key found for this signature in database
GPG Key ID: C25F9FD44CED595B
1 changed files with 1 additions and 1 deletions

View File

@ -46,7 +46,7 @@ if ( $reserve_id && $borrowernumber ) {
my $hold = Koha::Holds->find($reserve_id);
unless ( $hold->borrowernumber == $borrowernumber ) {
unless ( $hold && $hold->borrowernumber == $borrowernumber ) {
# whatcha tryin to do?
print $query->redirect('/cgi-bin/koha/errors/403.pl');