Also fix issues with normalizing ISBNs and the default
normalizer in C4::Matcher.
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
# Suite 330, Boston, MA 02111-1307 USA
use strict;
# Suite 330, Boston, MA 02111-1307 USA
use strict;
use C4::Context;
use C4::Koha;
use C4::Biblio;
use C4::Context;
use C4::Koha;
use C4::Biblio;
my ($title, $author, $isbn, $issn) = _parse_biblio_fields($marc_record);
my $dbh = C4::Context->dbh;
# FIXME no controlnumber, originalsource
my ($title, $author, $isbn, $issn) = _parse_biblio_fields($marc_record);
my $dbh = C4::Context->dbh;
# FIXME no controlnumber, originalsource
- # FIXME 2 - should regularize normalization of ISBN wherever it is done
- $isbn =~ s/\(.*$//;
- $isbn =~ tr/ -_//;
- $isbn = uc $isbn;
+ $isbn = C4::Koha::_isbn_cleanup($isbn); # FIXME C4::Koha::_isbn_cleanup should be made public
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();
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();
# Suite 330, Boston, MA 02111-1307 USA
use strict;
# Suite 330, Boston, MA 02111-1307 USA
use strict;
use C4::Context;
use MARC::Record;
use C4::Search;
use C4::Context;
use MARC::Record;
use C4::Search;
# FIXME - default normalizer
sub _normalize {
my $value = uc shift;
# FIXME - default normalizer
sub _normalize {
my $value = uc shift;
- $value =~ s/.;:,\]\[\)\(\/'"//g;
+ $value =~ s/[.;:,\]\[\)\(\/'"]//g;
$value =~ s/^\s+//;
#$value =~ s/^\s+$//;
$value =~ s/\s+$//;
$value =~ s/^\s+//;
#$value =~ s/^\s+$//;
$value =~ s/\s+$//;