From b7c405fc2f96ea914d4fb2c678bd3c7ce719cfea 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 --- C4/Biblio.pm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/C4/Biblio.pm b/C4/Biblio.pm index e84110cccc..7748ae2f60 100644 --- a/C4/Biblio.pm +++ b/C4/Biblio.pm @@ -2523,6 +2523,9 @@ sub TransformMarcToKohaOneField { if( $kohafield =~ /copyrightdate|publicationyear/ ) { $retval = _adjust_pubyear( $retval ); } + if( $kohafield =~ /isbn/ ) { + $retval =~ s/-//g; # Remove hyphens + } return $retval; } -- 2.30.0