From 1d9de57e236ae2c5f1866a44944d9a196ec4221e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fr=C3=A9d=C3=A9ric=20Demians?= Date: Wed, 2 Dec 2009 16:04:49 +0100 Subject: [PATCH] Bug 3784: Don't fail on opac-detail.pl with invalid biblionumber --- opac/opac-detail.pl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl index fdd1b875ea..87b2ac9add 100755 --- a/opac/opac-detail.pl +++ b/opac/opac-detail.pl @@ -66,6 +66,10 @@ $template->param( 'AllowOnShelfHolds' => C4::Context->preference('AllowOnShelfHo $template->param( 'ItemsIssued' => CountItemsIssued( $biblionumber ) ); my $record = GetMarcBiblio($biblionumber); +if ( ! $record ) { + print $query->redirect("/cgi-bin/koha/errors/404.pl"); + exit; +} $template->param( biblionumber => $biblionumber ); # XSLT processing of some stuff if (C4::Context->preference("XSLTDetailsDisplay") ) { @@ -87,10 +91,6 @@ if (C4::Context->preference('hidelostitems')) { } my $dat = &GetBiblioData($biblionumber); -if (!$dat) { - print $query->redirect("/cgi-bin/koha/errors/404.pl"); - exit; -} my $itemtypes = GetItemTypes(); # imageurl: my $itemtype = $dat->{'itemtype'}; -- 2.39.5