Bug 27266: (QA follow-up) Remove GetBiblioData from basket scripts
authorMarcel de Rooy <m.de.rooy@rijksmuseum.nl>
Fri, 5 Nov 2021 07:34:45 +0000 (07:34 +0000)
committerFridolin Somers <fridolin.somers@biblibre.com>
Wed, 15 Dec 2021 22:15:14 +0000 (12:15 -1000)
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 <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
basket/basket.pl
basket/sendbasket.pl
opac/opac-basket.pl
opac/opac-sendbasket.pl

index 84331cd..80a30ec 100755 (executable)
@@ -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;
index c52c2cf..3c53605 100755 (executable)
@@ -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 });
index 013cbab..ef137b9 100755 (executable)
@@ -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.
index 14dd409..d77a5b5 100755 (executable)
@@ -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,