X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;f=C4%2FImportBatch.pm;h=5f466134e2976090a0f3f5c4092a51fc44671aab;hb=aa00c3a6935b49b328969ad910a1e8363e678173;hp=a655f29614cf265d49b6010acf4383265c97e2c5;hpb=3e131101911fda60580b1dd757d078c172f19c3b;p=koha_fer diff --git a/C4/ImportBatch.pm b/C4/ImportBatch.pm index a655f29614..5f466134e2 100644 --- a/C4/ImportBatch.pm +++ b/C4/ImportBatch.pm @@ -382,6 +382,10 @@ sub BatchStageMarcRecords { if (scalar($marc_record->fields()) == 0) { push @invalid_records, $marc_blob; } else { + + # Normalize the record so it doesn't have separated diacritics + SetUTF8Flag($marc_record); + $num_valid++; if ($record_type eq 'biblio') { $import_record_id = AddBiblioToBatch($batch_id, $rec_num, $marc_record, $encoding, int(rand(99999)), 0); @@ -617,6 +621,7 @@ sub BatchCommitRecords { # remove item fields so that they don't get # added again if record is reverted + # FIXME: GetXmlBiblio output should not contain item info any more! So the next foreach should not be needed. Does not hurt either; may remove old 952s that should not have been there anymore. my $old_marc = MARC::Record->new_from_xml(StripNonXmlChars($oldxml), 'UTF-8', $rowref->{'encoding'}, $marc_type); foreach my $item_field ($old_marc->field($item_tag)) { $old_marc->delete_field($item_field); @@ -1306,7 +1311,7 @@ sub GetImportRecordMatches { $sth->execute(); while (my $row = $sth->fetchrow_hashref) { if ($row->{'record_type'} eq 'auth') { - $row->{'authorized_heading'} = GetAuthorizedHeading( { authid => $row->{'candidate_match_id'} } ); + $row->{'authorized_heading'} = C4::AuthoritiesMarc::GetAuthorizedHeading( { authid => $row->{'candidate_match_id'} } ); } next if ($row->{'record_type'} eq 'biblio' && not $row->{'biblionumber'}); push @$results, $row; @@ -1375,7 +1380,7 @@ sub _add_auth_fields { if ($marc_record->field('001')) { $controlnumber = $marc_record->field('001')->data(); } - my $authorized_heading = GetAuthorizedHeading({ record => $marc_record }); + my $authorized_heading = C4::AuthoritiesMarc::GetAuthorizedHeading({ record => $marc_record }); my $dbh = C4::Context->dbh; my $sth = $dbh->prepare("INSERT INTO import_auths (import_record_id, control_number, authorized_heading) VALUES (?, ?, ?)"); $sth->execute($import_record_id, $controlnumber, $authorized_heading);