diff --git a/C4/Breeding.pm b/C4/Breeding.pm index 69adcf42e0..f7ad472da6 100644 --- a/C4/Breeding.pm +++ b/C4/Breeding.pm @@ -110,7 +110,7 @@ sub ImportBreeding { # if isbn found and biblio does not exist, add it. If isbn found and biblio exists, # overwrite or ignore depending on user choice # drop every "special" char : spaces, - ... - $oldbiblio->{isbn} = C4::Koha::_isbn_cleanup($oldbiblio->{isbn}); # FIXME C4::Koha::_isbn_cleanup should be public + $oldbiblio->{isbn} = C4::Koha::GetNormalizedISBN($oldbiblio->{isbn}); # search if biblio exists my $biblioitemnumber; if ($oldbiblio->{isbn}) { @@ -175,6 +175,9 @@ sub BreedingSearch { my $sth; my @results; + # normalise ISBN like at import + $isbn = C4::Koha::GetNormalizedISBN($isbn); + $query = "SELECT import_record_id, file_name, isbn, title, author FROM import_biblios JOIN import_records USING (import_record_id) diff --git a/C4/ImportBatch.pm b/C4/ImportBatch.pm index c045878227..9439986fda 100644 --- a/C4/ImportBatch.pm +++ b/C4/ImportBatch.pm @@ -1437,7 +1437,7 @@ sub _add_biblio_fields { my ($title, $author, $isbn, $issn) = _parse_biblio_fields($marc_record); my $dbh = C4::Context->dbh; # FIXME no controlnumber, originalsource - $isbn = C4::Koha::_isbn_cleanup($isbn); # FIXME C4::Koha::_isbn_cleanup should be made public + $isbn = C4::Koha::GetNormalizedISBN($isbn); my $sth = $dbh->prepare("INSERT INTO import_biblios (import_record_id, title, author, isbn, issn) VALUES (?, ?, ?, ?, ?)"); $sth->execute($import_record_id, $title, $author, $isbn, $issn); $sth->finish(); diff --git a/cataloguing/addbooks.pl b/cataloguing/addbooks.pl index 35cfa2cf70..0cfd7e89de 100755 --- a/cataloguing/addbooks.pl +++ b/cataloguing/addbooks.pl @@ -116,7 +116,9 @@ if ($query) { #check is on isbn legnth 13 for new isbn and 10 for old isbn my ( $title, $isbn ); if ($query=~/\d/) { - my $querylength = length $query; + my $clean_query = $query; + $clean_query =~ s/-//g; # remove hyphens + my $querylength = length $clean_query; if ( $querylength == 13 || $querylength == 10 ) { $isbn = $query; }