Browse Source

Bug 19319: Only fetch the record if it exists

We already know if the bibliographic record exists (404 redirect),
we can avoid unecessary fetches

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
18.05.x
Jonathan Druart 6 years ago
parent
commit
2ba4af723c
  1. 5
      opac/opac-ISBDdetail.pl
  2. 3
      opac/opac-detail.pl

5
opac/opac-ISBDdetail.pl

@ -71,8 +71,6 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
my $biblionumber = $query->param('biblionumber');
$biblionumber = int($biblionumber);
my $biblio = Koha::Biblios->find( $biblionumber );
# get biblionumbers stored in the cart
if(my $cart_list = $query->cookie("bib_list")){
my @cart_list = split(/\//, $cart_list);
@ -102,6 +100,9 @@ if ( ! $record ) {
print $query->redirect("/cgi-bin/koha/errors/404.pl");
exit;
}
my $biblio = Koha::Biblios->find( $biblionumber );
my $framework = GetFrameworkCode( $biblionumber );
my $record_processor = Koha::RecordProcessor->new({
filters => 'ViewPolicy',

3
opac/opac-detail.pl

@ -78,7 +78,6 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
my $biblionumber = $query->param('biblionumber') || $query->param('bib') || 0;
$biblionumber = int($biblionumber);
my $biblio = Koha::Biblios->find( $biblionumber );
my @all_items = GetItemsInfo($biblionumber);
my @hiddenitems;
@ -96,6 +95,8 @@ if ( ! $record ) {
print $query->redirect("/cgi-bin/koha/errors/404.pl"); # escape early
exit;
}
my $biblio = Koha::Biblios->find( $biblionumber );
my $framework = &GetFrameworkCode( $biblionumber );
my $record_processor = Koha::RecordProcessor->new({
filters => 'ViewPolicy',

Loading…
Cancel
Save