From 1455d663d64c78a742a344f449bcc9a789a33603 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Mon, 8 Jun 2009 10:02:49 +1200 Subject: [PATCH] bug 2505: enable warnings in call number normalization modules Signed-off-by: Chris Cormack Signed-off-by: Galen Charlton --- C4/ClassSortRoutine.pm | 2 ++ C4/ClassSortRoutine/Dewey.pm | 4 +++- C4/ClassSortRoutine/Generic.pm | 4 +++- C4/ClassSortRoutine/LCC.pm | 4 +++- C4/ClassSource.pm | 2 ++ 5 files changed, 13 insertions(+), 3 deletions(-) diff --git a/C4/ClassSortRoutine.pm b/C4/ClassSortRoutine.pm index b4fa7a4285..6131081fae 100644 --- a/C4/ClassSortRoutine.pm +++ b/C4/ClassSortRoutine.pm @@ -18,6 +18,8 @@ package C4::ClassSortRoutine; # Suite 330, Boston, MA 02111-1307 USA use strict; +use warnings; + require Exporter; use Class::Factory::Util; use C4::Context; diff --git a/C4/ClassSortRoutine/Dewey.pm b/C4/ClassSortRoutine/Dewey.pm index c077e835d0..dd768ba127 100644 --- a/C4/ClassSortRoutine/Dewey.pm +++ b/C4/ClassSortRoutine/Dewey.pm @@ -18,7 +18,7 @@ package C4::ClassSortRoutine::Dewey; # Suite 330, Boston, MA 02111-1307 USA use strict; -require Exporter; +use warnings; use vars qw($VERSION); @@ -58,6 +58,8 @@ Generates sorting key using the following rules: sub get_class_sort_key { my ($cn_class, $cn_item) = @_; + $cn_class = '' unless defined $cn_class; + $cn_item = '' unless defined $cn_item; my $init = uc "$cn_class $cn_item"; $init =~ s/^\s+//; $init =~ s/\s+$//; diff --git a/C4/ClassSortRoutine/Generic.pm b/C4/ClassSortRoutine/Generic.pm index ded0239c7b..667ffb6be3 100644 --- a/C4/ClassSortRoutine/Generic.pm +++ b/C4/ClassSortRoutine/Generic.pm @@ -18,7 +18,7 @@ package C4::ClassSortRoutine::Generic; # Suite 330, Boston, MA 02111-1307 USA use strict; -require Exporter; +use warnings; use vars qw($VERSION); @@ -53,6 +53,8 @@ Generates sorting key using the following rules: sub get_class_sort_key { my ($cn_class, $cn_item) = @_; + $cn_class = '' unless defined $cn_class; + $cn_item = '' unless defined $cn_item; my $key = uc "$cn_class $cn_item"; $key =~ s/^\s+//; $key =~ s/\s+$//; diff --git a/C4/ClassSortRoutine/LCC.pm b/C4/ClassSortRoutine/LCC.pm index 6ef758927d..a4e34b29d3 100644 --- a/C4/ClassSortRoutine/LCC.pm +++ b/C4/ClassSortRoutine/LCC.pm @@ -18,7 +18,7 @@ package C4::ClassSortRoutine::LCC; # Suite 330, Boston, MA 02111-1307 USA use strict; -require Exporter; +use warnings; use vars qw($VERSION); @@ -48,6 +48,8 @@ Generates sorting key for LC call numbers. sub get_class_sort_key { my ($cn_class, $cn_item) = @_; + $cn_class = '' unless defined $cn_class; + $cn_item = '' unless defined $cn_item; my $key = uc "$cn_class $cn_item"; $key =~ s/^\s+//; $key =~ s/\s+$//; diff --git a/C4/ClassSource.pm b/C4/ClassSource.pm index 4a161ae6a2..ee468acaa7 100644 --- a/C4/ClassSource.pm +++ b/C4/ClassSource.pm @@ -18,6 +18,8 @@ package C4::ClassSource; # Suite 330, Boston, MA 02111-1307 USA use strict; +use warnings; + require Exporter; use C4::Context; use C4::Koha; -- 2.39.5