From 2bca235b26a1ba5f5b424ed8aefbcad22a377197 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Fri, 5 Jul 2019 06:07:25 +0000 Subject: [PATCH] Bug 23248: (QA follow-up) Consolidate 404s Merging two conditions: biblionumber is empty or biblionumber cannot be found. This make the strange int($biblionumber) unneeded. Signed-off-by: Marcel de Rooy Signed-off-by: Martin Renvoize (cherry picked from commit 7e559e59635e387ce53a894a67e4323e4984a15f) Signed-off-by: Fridolin Somers --- opac/opac-ISBDdetail.pl | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/opac/opac-ISBDdetail.pl b/opac/opac-ISBDdetail.pl index 4305d8c483..c79167cd31 100755 --- a/opac/opac-ISBDdetail.pl +++ b/opac/opac-ISBDdetail.pl @@ -59,11 +59,12 @@ use Koha::Biblios; my $query = CGI->new(); my $biblionumber = $query->param('biblionumber'); -if ( !$biblionumber ) { +my $biblio; +$biblio = Koha::Biblios->find( $biblionumber, { prefetch => [ 'metadata', 'items' ] } ) if $biblionumber; +if( !$biblio ) { print $query->redirect('/cgi-bin/koha/errors/404.pl'); exit; } -$biblionumber = int($biblionumber); #open template my ( $template, $loggedinuser, $cookie ) = get_template_and_user( @@ -76,12 +77,6 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( } ); -my $biblio = Koha::Biblios->find( $biblionumber, { prefetch => [ 'metadata', 'items' ] } ); -unless ( $biblio ) { - print $query->redirect("/cgi-bin/koha/errors/404.pl"); - exit; -} - my $patron = Koha::Patrons->find($loggedinuser); my $opachiddenitems_rules; -- 2.39.5