From: Galen Charlton Date: Sun, 7 Jun 2009 22:02:46 +0000 (+1200) Subject: bug 2505: enable warnings in C4::ImportBatch and C4::Matcher X-Git-Tag: n_acq_a_porter~26^2~106 X-Git-Url: http://git.rot13.org/?a=commitdiff_plain;h=ed014edad77b212f78c1b300b3e9b18ad25eaacc;p=koha.git bug 2505: enable warnings in C4::ImportBatch and C4::Matcher Also fix issues with normalizing ISBNs and the default normalizer in C4::Matcher. Signed-off-by: Chris Cormack Signed-off-by: Galen Charlton --- diff --git a/C4/ImportBatch.pm b/C4/ImportBatch.pm index 9ceb15a4a6..a8bd2cb7f5 100644 --- a/C4/ImportBatch.pm +++ b/C4/ImportBatch.pm @@ -18,6 +18,8 @@ package C4::ImportBatch; # Suite 330, Boston, MA 02111-1307 USA use strict; +use warnings; + use C4::Context; use C4::Koha; use C4::Biblio; @@ -1252,10 +1254,7 @@ sub _add_biblio_fields { 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(); diff --git a/C4/Matcher.pm b/C4/Matcher.pm index 512562c0e9..c9a1e46881 100644 --- a/C4/Matcher.pm +++ b/C4/Matcher.pm @@ -18,6 +18,8 @@ package C4::Matcher; # Suite 330, Boston, MA 02111-1307 USA use strict; +use warnings; + use C4::Context; use MARC::Record; use C4::Search; @@ -820,7 +822,7 @@ sub _parse_match_component { # FIXME - default normalizer sub _normalize { my $value = uc shift; - $value =~ s/.;:,\]\[\)\(\/'"//g; + $value =~ s/[.;:,\]\[\)\(\/'"]//g; $value =~ s/^\s+//; #$value =~ s/^\s+$//; $value =~ s/\s+$//;