From 0d768b482e032c5f9700df331d7aff71f9a23e6c Mon Sep 17 00:00:00 2001 From: Ian Walls Date: Wed, 6 Oct 2010 12:46:26 -0400 Subject: [PATCH] Followup to Bug 4305: multiple ISBNS in biblioitems.isbn breaks patron This patch adds a scrub for ' | ' when the ISBN comes from the biblioitems table, in the event that Koha has attempted to store multiple ISBNs in the field. The ISBN presented to Business::ISBN will now be something it can handle. Signed-off-by: Galen Charlton --- C4/Koha.pm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/C4/Koha.pm b/C4/Koha.pm index 89bb518ce1..ab9131a9fb 100644 --- a/C4/Koha.pm +++ b/C4/Koha.pm @@ -1242,6 +1242,9 @@ sub GetNormalizedISBN { my ($isbn,$record,$marcflavour) = @_; my @fields; if ($isbn) { + # Koha attempts to store multiple ISBNs in biblioitems.isbn, separated by " | " + # anything after " | " should be removed, along with the delimiter + $isbn =~ s/(.*)( \| )(.*)/$1/; return _isbn_cleanup($isbn); } return undef unless $record; -- 2.39.5