Bug 28779: Skip processing of non-existent biblios

Just checking with a regex that whether an input looks like a biblionumber
is not enough, we need to also verify there is a biblio really existing
in the database and skip processing of hold request for non-existent
biblionumbers.

To test:
 1) Go to page /cgi-bin/koha/reserve/request.pl?biblionumbers=XXXXX
    where XXXXX is non-existent biblionumber, notice internal server error
 2) Apply patch
 3) Repeat step 1 and notice we cannot place a hold

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Petro Vashchuk <stalkernoid@gmail.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Joonas Kylmälä 2021-07-29 19:35:47 +03:00 committed by Jonathan Druart
parent c1fbfa5faf
commit 96ea4a4dde
1 changed files with 5 additions and 0 deletions

View File

@ -307,6 +307,11 @@ foreach my $biblionumber (@biblionumbers) {
my %biblioloopiter = ();
my $biblio = Koha::Biblios->find( $biblionumber );
unless ($biblio) {
$biblioloopiter{noitems} = 1;
$template->param('noitems' => 1);
next;
}
my $force_hold_level;
if ( $patron ) {