From ea1f85c3e08efe6dccf0eb38eec315ce1846b349 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Thu, 26 May 2022 11:54:44 +0000 Subject: [PATCH] Bug 30813: (follow-up) Correct C4::Breeding call MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch changes the call to use the fully qualified name and adds import to C4::Breeding, Koha::MetaSearcher, and removes import from Koha::MetadataRecord Additionally it replaces missing fields from the update to using TransformMarcToKoha Lastly, it reduces the fields used when saving the bredding record to the reservoir Signed-off-by: Joonas Kylmälä --- C4/Breeding.pm | 5 ++++- C4/ImportBatch.pm | 2 +- Koha/MetaSearcher.pm | 1 + Koha/MetadataRecord.pm | 1 - 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/C4/Breeding.pm b/C4/Breeding.pm index 48ea5acfab..866350b645 100644 --- a/C4/Breeding.pm +++ b/C4/Breeding.pm @@ -308,7 +308,10 @@ sub _handle_one_result { if( $breedingid ){ my @kohafields = ('biblio.title','biblio.author','biblioitems.isbn','biblioitems.lccn','biblioitems.editionstatement'); push @kohafields, C4::Context->preference('marcflavour') eq "MARC21" ? 'biblio.copyrightdate' : 'biblioitems.publicationyear'; - $row = TransformMarcToKoha({ record => $marcrecord, kohafields => \@kohafields, limit_table => 'no_items' }); + $row = C4::Biblio::TransformMarcToKoha({ record => $marcrecord, kohafields => \@kohafields, limit_table => 'no_items' }); + $row->{biblionumber} = $bib; + $row->{server} = $servhref->{servername}; + $row->{breedingid} = $breedingid; $row->{isbn}=_isbn_replace($row->{isbn}); $row = _add_custom_field_rowdata($row, $marcrecord); } diff --git a/C4/ImportBatch.pm b/C4/ImportBatch.pm index 32b741fd95..1578db7b86 100644 --- a/C4/ImportBatch.pm +++ b/C4/ImportBatch.pm @@ -1710,7 +1710,7 @@ sub _parse_biblio_fields { my ($marc_record) = @_; my $dbh = C4::Context->dbh; - my $bibliofields = TransformMarcToKoha({ record => $marc_record }); + my $bibliofields = TransformMarcToKoha({ record => $marc_record, kohafields => ['biblio.title','biblio.author','biblioitems.isbn','biblioitems.issn'] }); return ($bibliofields->{'title'}, $bibliofields->{'author'}, $bibliofields->{'isbn'}, $bibliofields->{'issn'}); } diff --git a/Koha/MetaSearcher.pm b/Koha/MetaSearcher.pm index 16a343f48d..e33e69b323 100644 --- a/Koha/MetaSearcher.pm +++ b/Koha/MetaSearcher.pm @@ -21,6 +21,7 @@ use Modern::Perl; use base 'Class::Accessor'; +use C4::Biblio; use C4::Charset qw( MarcToUTF8Record SetUTF8Flag ); use C4::Search qw( new_record_from_zebra ); use DBIx::Class::ResultClass::HashRefInflator; diff --git a/Koha/MetadataRecord.pm b/Koha/MetadataRecord.pm index b288d98c1d..6f0aa1fb4b 100644 --- a/Koha/MetadataRecord.pm +++ b/Koha/MetadataRecord.pm @@ -35,7 +35,6 @@ and authority) records in Koha. use Modern::Perl; use Carp qw( carp ); -use C4::Biblio; use Koha::Util::MARC; use base qw(Class::Accessor); -- 2.30.2