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 <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
Marcel de Rooy 2019-07-05 06:07:25 +00:00 committed by Martin Renvoize
parent c3f0732eb7
commit 7e559e5963
No known key found for this signature in database
GPG Key ID: 422B469130441A0F
1 changed files with 3 additions and 8 deletions

View File

@ -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;