[Koha-patches] [PATCH] Bug 3784: Don't fail on opac-detail.pl with invalid biblionumber

Frédéric Demians f.demians at tamil.fr
Wed Dec 2 16:01:34 CET 2009


Same as Chris patch but without redundant code
---
 opac/opac-detail.pl |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl
index c3b104b..67f5dd0 100755
--- a/opac/opac-detail.pl
+++ b/opac/opac-detail.pl
@@ -65,6 +65,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") ) {
@@ -86,10 +90,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'};
-- 
1.6.4.3




More information about the Koha-patches mailing list