Browse Source

Bug 30813: (follow-up) Correct C4::Breeding call

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ä <joonas.kylmala@iki.fi>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
22.11.x
Nick Clemens 2 years ago
committed by Tomas Cohen Arazi
parent
commit
7f10ee6df0
Signed by: tomascohen GPG Key ID: 0A272EA1B2F3C15F
  1. 5
      C4/Breeding.pm
  2. 2
      C4/ImportBatch.pm
  3. 1
      Koha/MetaSearcher.pm
  4. 1
      Koha/MetadataRecord.pm

5
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);
}

2
C4/ImportBatch.pm

@ -1685,7 +1685,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'});
}

1
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;

1
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);

Loading…
Cancel
Save