[Koha-patches] [PATCH] (bug #3598) normalize isbn

Galen Charlton gmcharlt at gmail.com
Wed Sep 16 04:03:18 CEST 2009


Hi,

I will not be pushing this patch as proposed, as records imported via
Z39.50 should not be munged in this manner.  Many AACR2-based
catalogers would object to having an ISBN entered according to ISBD
rules, e.g.,

020  	##$a0914378260 (pbk. : v. 1) :$c$5.00

be automatically converted upon record import to

020  	##$a0914378260c$5.00

ISBNs should be normalized *outside* of the MARC record as needed for
indexing and searching.  To unconditionally strip away data from the
source MARC record would only lead to the impression that Koha is not
suitable for traditional MARC cataloging.  You may not like the rules,
but I don't make 'em.  You really do have to do this hard way -
normalize the ISBN for indexing and searching.  Fortunately, there's
another patch in the queue that will help get us there.

Regards,

Galen

On Thu, Sep 10, 2009 at 8:52 AM, Nahuel ANGELINETTI
<nahuel.angelinetti at biblibre.com> wrote:
> This patch normalize isbn's of notices imported via z39.50
> ---
>  cataloguing/z3950_search.pl |   20 ++++++++++++++++++++
>  1 files changed, 20 insertions(+), 0 deletions(-)
>
> diff --git a/cataloguing/z3950_search.pl b/cataloguing/z3950_search.pl
> index df2fab1..53d48a6 100755
> --- a/cataloguing/z3950_search.pl
> +++ b/cataloguing/z3950_search.pl
> @@ -207,6 +207,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
> --
> 1.6.0.4
>
> _______________________________________________
> Koha-patches mailing list
> Koha-patches at lists.koha.org
> http://lists.koha.org/mailman/listinfo/koha-patches
>



-- 
Galen Charlton
gmcharlt at gmail.com



More information about the Koha-patches mailing list