X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=catalogue%2Fdetail.pl;h=87387375e70314f1e59d43772e9abe4b249ed136;hb=d8a36ca1f80460029ec5442fb1bf5de8b00a2138;hp=21fcb1f1381eb49c43330a8310dbcdb6c254cf5b;hpb=f8ea370fdd5e62c38dc22b3ee7c8eebcf9a4a780;p=koha.git diff --git a/catalogue/detail.pl b/catalogue/detail.pl index 21fcb1f138..87387375e7 100755 --- a/catalogue/detail.pl +++ b/catalogue/detail.pl @@ -51,6 +51,17 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user( } ); +my $biblionumber = $query->param('biblionumber'); +my $record = GetMarcBiblio($biblionumber); + +if ( not defined $record ) { + # biblionumber invalid -> report and exit + $template->param( unknownbiblionumber => 1, + biblionumber => $biblionumber ); + output_html_with_http_headers $query, $cookie, $template->output; + exit; +} + if($query->cookie("holdfor")){ my $holdfor_patron = GetMember('borrowernumber' => $query->cookie("holdfor")); $template->param( @@ -61,14 +72,9 @@ if($query->cookie("holdfor")){ ); } -my $biblionumber = $query->param('biblionumber'); -my $fw = GetFrameworkCode($biblionumber); - +my $fw = GetFrameworkCode($biblionumber); my $showallitems = $query->param('showallitems'); - -## get notes and subjects from MARC record -my $marcflavour = C4::Context->preference("marcflavour"); -my $record = GetMarcBiblio($biblionumber); +my $marcflavour = C4::Context->preference("marcflavour"); # XSLT processing of some stuff if (C4::Context->preference("XSLTDetailsDisplay") ) { @@ -93,11 +99,6 @@ $template->param( normalized_isbn => $isbn, ); -unless (defined($record)) { - print $query->redirect("/cgi-bin/koha/errors/404.pl"); - exit; -} - my $marcnotesarray = GetMarcNotes( $record, $marcflavour ); my $marcisbnsarray = GetMarcISBN( $record, $marcflavour ); my $marcauthorsarray = GetMarcAuthors( $record, $marcflavour ); @@ -111,8 +112,7 @@ my $branches = GetBranches(); my $itemtypes = GetItemTypes(); my $dbh = C4::Context->dbh; -# 'intra' param included, even though it's not respected in GetItemsInfo currently -my @all_items= GetItemsInfo($biblionumber, 'intra'); +my @all_items = GetItemsInfo( $biblionumber ); my @items; for my $itm (@all_items) { push @items, $itm unless ( $itm->{itemlost} && GetHideLostItemsPreference($borrowernumber) && !$showallitems);