bug 2505: further warnings fixes to memberentry.pl
authorGalen Charlton <galen.charlton@liblime.com>
Tue, 30 Dec 2008 01:42:45 +0000 (19:42 -0600)
committerHenri-Damien LAURENT <henridamien@koha-fr.org>
Tue, 27 Jan 2009 11:19:41 +0000 (12:19 +0100)
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
members/memberentry.pl

index 57b520d..7b88eca 100755 (executable)
@@ -19,7 +19,7 @@
 
 # pragma
 use strict;
-use warnings;  # FIXME: really.
+use warnings;
 
 # external modules
 use CGI;
@@ -115,8 +115,10 @@ my %newdata;       # comes from $input->param()
 if ($op eq 'insert' || $op eq 'modify' || $op eq 'save') {
     my @names= ($borrower_data && $op ne 'save') ? keys %$borrower_data : $input->param();
     foreach my $key (@names) {
-        $newdata{$key} = $input->param($key) if (defined $input->param($key));
-        $newdata{$key} =~ s/\"/&quot;/gg unless $key eq 'borrowernotes' or $key eq 'opacnote';
+        if (defined $input->param($key)) {
+            $newdata{$key} = $input->param($key);
+            $newdata{$key} =~ s/\"/&quot;/g unless $key eq 'borrowernotes' or $key eq 'opacnote';
+        }
     }
     my $dateobject = C4::Dates->new();
     my $syspref = $dateobject->regexp();               # same syspref format for all 3 dates
@@ -376,7 +378,7 @@ foreach (qw(C A S P I X)) {
 $template->param('typeloop' => \@typeloop);
 
 # test in city
-$select_city=getidcity($data{'city'}) if ($guarantorid ne '0');
+$select_city=getidcity($data{'city'}) if defined $guarantorid and ($guarantorid ne '0');
 ($default_city=$select_city) if ($step eq 0);
 if (!defined($select_city) or $select_city eq '' ){
        $default_city = &getidcity($data{'city'});