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 <gmcharlt@gmail.com>
This commit is contained in:
Ian Walls 2010-10-06 12:46:26 -04:00 committed by Galen Charlton
parent 6049aeeacb
commit 0d768b482e
1 changed files with 3 additions and 0 deletions

View File

@ -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;