From 213db88383a1fb52d854412f9a5d2f11c3fe1ba3 Mon Sep 17 00:00:00 2001 From: Fridolin Somers Date: Wed, 24 Feb 2021 16:31:07 +0100 Subject: [PATCH] Bug 27774: Always remove hyphens from ISBN when cataloging Actually hyphens are removed from ISBN when using acquisition or z3950 cataloguing or with bulkmarcimport. I propose to add this behavior in TransformMarcToKoha() so MARC data is unchanged, but biblioitems.isbn is without hyphens. This can be used if search using SQL and in reports. We may after this remove other codes that remove hyphens before cataloguing a biblio record. Test plan : 1) Create a new record with an ISBN with hyphen, ie 978-0008376109 2) Save 3) Export to MARCXML and see ISBN has hyphen 4) Look into database : select isbn from biblioitems where bilionumber=xxx 5) Check you see ISBN without hyphen Signed-off-by: Frank Hansen Signed-off-by: Kyle M Hall --- C4/Biblio.pm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/C4/Biblio.pm b/C4/Biblio.pm index f6c89f92e8..2390ce00b5 100644 --- a/C4/Biblio.pm +++ b/C4/Biblio.pm @@ -2429,6 +2429,9 @@ sub TransformMarcToKohaOneField { if( $kohafield =~ /copyrightdate|publicationyear/ ) { $retval = _adjust_pubyear( $retval ); } + if( $kohafield =~ /isbn/ ) { + $retval =~ s/-//g; # Remove hyphens + } return $retval; } -- 2.24.3 (Apple Git-128)