From 441f57184dd105af6bf1d36547f194b7d9349422 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Fri, 5 Nov 2021 07:34:45 +0000 Subject: [PATCH] Bug 27266: (QA follow-up) Remove GetBiblioData from basket scripts We are adding (or already doing) a Koha::Biblios->find, so we should get rid of GetBiblioData, fetching the same data. It returned a few extra columns, but unused here: $dat->{bnotes}, $dat->{bi_notforloan} Signed-off-by: Marcel de Rooy Signed-off-by: Fridolin Somers --- basket/basket.pl | 6 ++---- basket/sendbasket.pl | 6 ++---- opac/opac-basket.pl | 6 ++---- opac/opac-sendbasket.pl | 6 ++---- 4 files changed, 8 insertions(+), 16 deletions(-) diff --git a/basket/basket.pl b/basket/basket.pl index 84331cdf9b..80a30ecee5 100755 --- a/basket/basket.pl +++ b/basket/basket.pl @@ -20,7 +20,6 @@ use Modern::Perl; use CGI qw ( -utf8 ); use C4::Koha; use C4::Biblio qw( - GetBiblioData GetMarcBiblio GetMarcSeries GetMarcSubjects @@ -66,9 +65,8 @@ if (C4::Context->preference('TagsEnabled')) { foreach my $biblionumber ( @bibs ) { $template->param( biblionumber => $biblionumber ); - my $dat = &GetBiblioData($biblionumber); - next unless $dat; - my $biblio = Koha::Biblios->find( $biblionumber ); + my $biblio = Koha::Biblios->find( $biblionumber ) or next; + my $dat = $biblio->unblessed; my $record = &GetMarcBiblio({ biblionumber => $biblionumber }); my $marcnotesarray = $biblio->get_marc_notes({ marcflavour => $marcflavour }); my $marcauthorsarray = $biblio->get_marc_authors; diff --git a/basket/sendbasket.pl b/basket/sendbasket.pl index c52c2cf69c..3c53605069 100755 --- a/basket/sendbasket.pl +++ b/basket/sendbasket.pl @@ -23,7 +23,6 @@ use Carp qw( carp ); use Try::Tiny qw( catch try ); use C4::Biblio qw( - GetBiblioData GetMarcBiblio GetMarcSubjects ); @@ -71,9 +70,8 @@ if ( $email_add ) { foreach my $biblionumber (@bibs) { $template2->param( biblionumber => $biblionumber ); - my $dat = GetBiblioData($biblionumber); - next unless $dat; - my $biblio = Koha::Biblios->find( $biblionumber ); + my $biblio = Koha::Biblios->find( $biblionumber ) or next; + my $dat = $biblio->unblessed; my $record = GetMarcBiblio({ biblionumber => $biblionumber, embed_items => 1 }); diff --git a/opac/opac-basket.pl b/opac/opac-basket.pl index 013cbab083..ef137b95b0 100755 --- a/opac/opac-basket.pl +++ b/opac/opac-basket.pl @@ -21,7 +21,6 @@ use CGI qw ( -utf8 ); use C4::Koha; use C4::Biblio qw( - GetBiblioData GetFrameworkCode GetMarcBiblio GetMarcSeries @@ -78,9 +77,8 @@ my $rules = C4::Context->yaml_preference('OpacHiddenItems'); foreach my $biblionumber ( @bibs ) { $template->param( biblionumber => $biblionumber ); - my $dat = &GetBiblioData($biblionumber); - next unless $dat; - my $biblio = Koha::Biblios->find( $biblionumber ); + my $biblio = Koha::Biblios->find( $biblionumber ) or next; + my $dat = $biblio->unblessed; # No filtering on the item records needed for the record itself # since the only reason item information is grabbed is because of branchcodes. diff --git a/opac/opac-sendbasket.pl b/opac/opac-sendbasket.pl index 14dd409667..d77a5b5b34 100755 --- a/opac/opac-sendbasket.pl +++ b/opac/opac-sendbasket.pl @@ -25,7 +25,6 @@ use Carp qw( carp ); use Try::Tiny qw( catch try ); use C4::Biblio qw( - GetBiblioData GetMarcBiblio GetMarcSubjects ); @@ -78,9 +77,8 @@ if ( $email_add ) { foreach my $biblionumber (@bibs) { $template2->param( biblionumber => $biblionumber ); - my $dat = GetBiblioData($biblionumber); - next unless $dat; - my $biblio = Koha::Biblios->find( $biblionumber ); + my $biblio = Koha::Biblios->find( $biblionumber ) or next; + my $dat = $biblio->unblessed; my $record = GetMarcBiblio({ biblionumber => $biblionumber, embed_items => 1, -- 2.39.5