From 16be875060b27002b4aff967f3cf583474d80dcb Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 21 Jan 2022 11:04:23 +0100 Subject: [PATCH] Bug 29697: Special case - opac not needed Signed-off-by: Marcel de Rooy --- opac/opac-detail.pl | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl index b281c958f6f..343c9c5f5bf 100755 --- a/opac/opac-detail.pl +++ b/opac/opac-detail.pl @@ -38,7 +38,6 @@ use C4::Output qw( parametrized_url output_html_with_http_headers ); use C4::Biblio qw( CountItemsIssued GetBiblioData - GetMarcBiblio GetMarcControlnumber GetMarcISBN GetMarcISSN @@ -112,15 +111,13 @@ if( $specific_item ) { my @hiddenitems; my $patron = Koha::Patrons->find( $borrowernumber ); -my $record = GetMarcBiblio({ - biblionumber => $biblionumber, - opac => 1 }); -if ( ! $record ) { +my $biblio = Koha::Biblios->find( $biblionumber ); +my $record = $biblio ? $biblio->metadata->record : undef; +unless ( $biblio && $record ) { print $query->redirect("/cgi-bin/koha/errors/404.pl"); # escape early exit; } -my $biblio = Koha::Biblios->find( $biblionumber ); unless ( $patron and $patron->category->override_hidden_items ) { # only skip this check if there's a logged in user # and its category overrides OpacHiddenItems -- 2.25.1