From c5ac051f70c1f6a6ffd1b98e3a40a21ef3799f0a Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Thu, 19 Jun 2008 16:20:28 -0500 Subject: [PATCH] bug 2264: do not clear patron zipcode and city When edting only a part of the patron record (e.g., the library use section or the alternate address), the zipcode and city were cleared due to an error in form processing. Now the city and zipcode are set only of those fields are actually in the submitted form. Signed-off-by: Joshua Ferraro --- members/memberentry.pl | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/members/memberentry.pl b/members/memberentry.pl index ba6b9d7814..bf7379c8db 100755 --- a/members/memberentry.pl +++ b/members/memberentry.pl @@ -70,8 +70,6 @@ my $check_member=$input->param('check_member'); my $name_city=$input->param('name_city'); my $nodouble=$input->param('nodouble'); my $select_city=$input->param('select_city'); -my $zipcode=$input->param('zipcode'); -my $city=$input->param('city'); my $nok=$input->param('nok'); my $guarantorinfo=$input->param('guarantorinfo'); my $step=$input->param('step') || 0; @@ -171,9 +169,10 @@ if (($category_type eq 'C' || $category_type eq 'P') and $guarantorid ne '' ){ } ###############test to take the right zipcode and city name ############## -if ( $guarantorid eq ''){ - $newdata{'city'}= $city; - $newdata{'zipcode'}=$zipcode; +if ($guarantorid eq '') { + # set only if parameter was passed from the form + $newdata{'city'} = $input->param('city') if defined($input->param('city')); + $newdata{'zipcode'} = $input->param('zipcode') if defined($input->param('zipcode')); } #builds default userid -- 2.39.5