Bug 5915 : C4::AuthoritiesMarc AddAuthority

Fixing 100$a simple error: Sometimes, language is encoded fre50 and not
frey50.
This patch adds check for that problem

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
This commit is contained in:
Paul Poulain 2011-04-05 11:04:42 +02:00 committed by Chris Cormack
parent 3974ac63c9
commit c9def93286

View file

@ -651,17 +651,21 @@ sub AddAuthority {
}
}
if (($format eq "UNIMARCAUTH") && (!$record->subfield('100','a'))){
if ($format eq "UNIMARCAUTH") {
$record->leader(" nx j22 ") unless ($record->leader());
my $date=POSIX::strftime("%Y%m%d",localtime);
if ($record->field('100')){
if (my $string=$record->subfield('100',"a")){
$string=~s/fre50/frey50/;
$record->field('100')->update('a'=>$string);
}
elsif ($record->field('100')){
$record->field('100')->update('a'=>$date."afrey50 ba0");
} else {
$record->append_fields(
MARC::Field->new('100',' ',' '
,'a'=>$date."afrey50 ba0")
);
}
} else {
$record->append_fields(
MARC::Field->new('100',' ',' '
,'a'=>$date."afrey50 ba0")
);
}
}
my ($auth_type_tag, $auth_type_subfield) = get_auth_type_location($authtypecode);
if (!$authid and $format eq "MARC21") {