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:
parent
c3f0732eb7
commit
7e559e5963
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue