From 10aa6096fc4208e30e209af026ee3285df2fdae9 Mon Sep 17 00:00:00 2001 From: Nahuel ANGELINETTI Date: Thu, 10 Sep 2009 14:52:01 +0200 Subject: [PATCH] (bug #3598) normalize isbn This patch normalize isbn's of notices imported via z39.50 --- cataloguing/z3950_search.pl | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/cataloguing/z3950_search.pl b/cataloguing/z3950_search.pl index be180191be..39881a849b 100755 --- a/cataloguing/z3950_search.pl +++ b/cataloguing/z3950_search.pl @@ -225,6 +225,26 @@ warn "query ".$query if $DEBUG; my ($charset_result, $charset_errors); ($marcrecord, $charset_result, $charset_errors) = MarcToUTF8Record($marcdata, C4::Context->preference('marcflavour'), $encoding[$k]); + + # We clean the ISBN + my ($bibliotag,$bibliosubf)=GetMarcFromKohaField('biblioitems.isbn',''); + + if ($bibliotag<10){ + $isbn = $marcrecord->field($bibliotag)->data; + }else{ + $isbn = $marcrecord->subfield($bibliotag,$bibliosubf); + } + + $isbn = C4::Koha::_isbn_cleanup($isbn); + + if($marcrecord->field($bibliotag)){ + if($bibliotag < 10){ + $marcrecord->field($bibliotag)->update($isbn) + }else{ + $marcrecord->field($bibliotag)->update($bibliosubf => $isbn); + } + } + ####WARNING records coming from Z3950 clients are in various character sets MARC8,UTF8,UNIMARC etc ## In HEAD i change everything to UTF-8 # In rel2_2 i am not sure what encoding is so no character conversion is done here -- 2.39.5