From d2e2b800a8c53f34ce3762a5975e0bc3f50e1ce6 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 17 Jan 2022 17:41:39 +0100 Subject: [PATCH] Bug 29897: Rename get_marc_authors with get_marc_contributors get_marc_authors actually return authors from 700..712, not the first author from 200 Sponsored-by: Orex Digital Signed-off-by: Orex Digital --- Koha/Biblio.pm | 10 +++++----- basket/basket.pl | 2 +- basket/sendbasket.pl | 2 +- opac/opac-basket.pl | 2 +- opac/opac-sendbasket.pl | 2 +- opac/opac-sendshelf.pl | 2 +- t/db_dependent/Koha/Biblio.t | 4 ++-- virtualshelves/sendshelf.pl | 2 +- 8 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Koha/Biblio.pm b/Koha/Biblio.pm index 4022819e9c..8eaa23087a 100644 --- a/Koha/Biblio.pm +++ b/Koha/Biblio.pm @@ -967,16 +967,16 @@ sub get_marc_notes { return \@marcnotes; } -=head3 get_marc_authors +=head3 get_marc_contributors - my $authors = $biblio->get_marc_authors; + my $contributors = $biblio->get_marc_contributors; -Get all authors from the MARC record and returns them in an array. -The authors are stored in different fields depending on MARC flavour +Get all contributors (but first author) from the MARC record and returns them in an array. +They are stored in different fields depending on MARC flavour =cut -sub get_marc_authors { +sub get_marc_contributors { my ( $self, $params ) = @_; my ( $mintag, $maxtag, $fields_filter ); diff --git a/basket/basket.pl b/basket/basket.pl index f6943d9fb9..47dec08251 100755 --- a/basket/basket.pl +++ b/basket/basket.pl @@ -69,7 +69,7 @@ foreach my $biblionumber ( @bibs ) { my $dat = $biblio->unblessed; my $record = &GetMarcBiblio({ biblionumber => $biblionumber }); my $marcnotesarray = $biblio->get_marc_notes({ marcflavour => $marcflavour }); - my $marcauthorsarray = $biblio->get_marc_authors; + my $marcauthorsarray = $biblio->get_marc_contributors; my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour ); my $marcseriesarray = GetMarcSeries ($record,$marcflavour); my $marcurlsarray = GetMarcUrls ($record,$marcflavour); diff --git a/basket/sendbasket.pl b/basket/sendbasket.pl index 3c53605069..edb1fb2bac 100755 --- a/basket/sendbasket.pl +++ b/basket/sendbasket.pl @@ -75,7 +75,7 @@ if ( $email_add ) { my $record = GetMarcBiblio({ biblionumber => $biblionumber, embed_items => 1 }); - my $marcauthorsarray = $biblio->get_marc_authors; + my $marcauthorsarray = $biblio->get_marc_contributors; my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour ); my @items = GetItemsInfo( $biblionumber ); diff --git a/opac/opac-basket.pl b/opac/opac-basket.pl index 4304541013..062f864ce3 100755 --- a/opac/opac-basket.pl +++ b/opac/opac-basket.pl @@ -91,7 +91,7 @@ foreach my $biblionumber ( @bibs ) { $record_processor->process($record); next unless $record; my $marcnotesarray = $biblio->get_marc_notes({ marcflavour => $marcflavour, opac => 1 }); - my $marcauthorsarray = $biblio->get_marc_authors; + my $marcauthorsarray = $biblio->get_marc_contributors; my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour ); my $marcseriesarray = GetMarcSeries ($record,$marcflavour); my $marcurlsarray = GetMarcUrls ($record,$marcflavour); diff --git a/opac/opac-sendbasket.pl b/opac/opac-sendbasket.pl index d77a5b5b34..670cc34c6b 100755 --- a/opac/opac-sendbasket.pl +++ b/opac/opac-sendbasket.pl @@ -84,7 +84,7 @@ if ( $email_add ) { embed_items => 1, opac => 1, borcat => $borcat }); - my $marcauthorsarray = $biblio->get_marc_authors; + my $marcauthorsarray = $biblio->get_marc_contributors; my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour ); my @items = GetItemsInfo( $biblionumber ); diff --git a/opac/opac-sendshelf.pl b/opac/opac-sendshelf.pl index 4b33d8ef97..afb7a59dc5 100755 --- a/opac/opac-sendshelf.pl +++ b/opac/opac-sendshelf.pl @@ -93,7 +93,7 @@ if ( $shelf and $shelf->can_be_viewed( $borrowernumber ) ) { next unless $record; my $fw = GetFrameworkCode($biblionumber); - my $marcauthorsarray = $biblio->get_marc_authors; + my $marcauthorsarray = $biblio->get_marc_contributors; my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour ); my @items = GetItemsInfo( $biblionumber ); diff --git a/t/db_dependent/Koha/Biblio.t b/t/db_dependent/Koha/Biblio.t index 0a7ed4d43f..e32022d0c2 100755 --- a/t/db_dependent/Koha/Biblio.t +++ b/t/db_dependent/Koha/Biblio.t @@ -856,7 +856,7 @@ subtest 'current_checkouts() and old_checkouts() tests' => sub { $schema->storage->txn_rollback; }; -subtest 'get_marc_authors() tests' => sub { +subtest 'get_marc_contributors() tests' => sub { plan tests => 1; @@ -879,7 +879,7 @@ subtest 'get_marc_authors() tests' => sub { C4::Biblio::ModBiblio( $record, $biblio->biblionumber ); $biblio = Koha::Biblios->find( $biblio->biblionumber ); - is( 4, @{$biblio->get_marc_authors}, 'get_marc_authors retrieves correct number of author subfields' ); + is( 4, @{$biblio->get_marc_contributors}, 'get_marc_contributors retrieves correct number of author subfields' ); $schema->storage->txn_rollback; }; diff --git a/virtualshelves/sendshelf.pl b/virtualshelves/sendshelf.pl index 504481b6ca..f6057f14ae 100755 --- a/virtualshelves/sendshelf.pl +++ b/virtualshelves/sendshelf.pl @@ -81,7 +81,7 @@ if ($to_address) { my $record = GetMarcBiblio({ biblionumber => $biblionumber, embed_items => 1 }); - my $marcauthorsarray = $biblio->get_marc_authors; + my $marcauthorsarray = $biblio->get_marc_contributors; my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour ); my @items = GetItemsInfo($biblionumber); -- 2.30.2