From 6b4512d5c40b552a45fced0f48635af355d55efa Mon Sep 17 00:00:00 2001 From: Henri-Damien LAURENT Date: Tue, 22 Mar 2011 10:59:52 +0100 Subject: [PATCH] Bug 5909 : SetUTF8Flag on any incoming data This prompts NFC normalization on adding record Therefore, any saved record will be NFC normalized Signed-off-by: Julian Maurice Signed-off-by: Chris Cormack --- C4/AuthoritiesMarc.pm | 3 ++- C4/Biblio.pm | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/C4/AuthoritiesMarc.pm b/C4/AuthoritiesMarc.pm index f3cc948d89..3e6ca182ae 100644 --- a/C4/AuthoritiesMarc.pm +++ b/C4/AuthoritiesMarc.pm @@ -624,6 +624,7 @@ sub AddAuthority { $f5->update($time.".0"); } + SetUTF8Flag($record); if ($format eq "MARC21") { if (!$record->leader) { $record->leader($leader); @@ -650,7 +651,7 @@ sub AddAuthority { } if (($format eq "UNIMARCAUTH") && (!$record->subfield('100','a'))){ - $record->leader(" nx j22 "); + $record->leader(" nx j22 ") unless ($record->leader()); my $date=POSIX::strftime("%Y%m%d",localtime); if ($record->field('100')){ $record->field('100')->update('a'=>$date."afrey50 ba0"); diff --git a/C4/Biblio.pm b/C4/Biblio.pm index 0914d3534d..8143ee1095 100644 --- a/C4/Biblio.pm +++ b/C4/Biblio.pm @@ -250,6 +250,7 @@ sub AddBiblio { my $dbh = C4::Context->dbh; # transform the data into koha-table style data + SetUTF8Flag($record); my $olddata = TransformMarcToKoha( $dbh, $record, $frameworkcode ); ( $biblionumber, $error ) = _koha_add_biblio( $dbh, $olddata, $frameworkcode ); $olddata->{'biblionumber'} = $biblionumber; @@ -294,6 +295,7 @@ sub ModBiblio { logaction( "CATALOGUING", "MODIFY", $biblionumber, "BEFORE=>" . $newrecord->as_formatted ); } + SetUTF8Flag($record); my $dbh = C4::Context->dbh; $frameworkcode = "" unless $frameworkcode; -- 2.39.5