@@ -, +, @@ error --- members/memberentry.pl | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) --- a/members/memberentry.pl +++ a/members/memberentry.pl @@ -250,19 +250,6 @@ if ( ( $op eq 'insert' ) and !$nodouble ) { if ( $patrons->count > 0) { $nodouble = 0; $check_member = $patrons->next->borrowernumber; - - - my @new_guarantors; - my @new_guarantor_id = $input->multi_param('new_guarantor_id'); - my @new_guarantor_relationship = $input->multi_param('new_guarantor_relationship'); - foreach my $gid ( @new_guarantor_id ) { - my $patron = Koha::Patrons->find( $gid ); - my $relationship = shift( @new_guarantor_relationship ); - next unless $patron; - my $g = { patron => $patron, relationship => $relationship }; - push( @new_guarantors, $g ); - } - $template->param( new_guarantors => \@new_guarantors ); } } @@ -713,6 +700,19 @@ if ($nok) { $template->param($error) || $template->param( $error => 1); } $template->param(nok => 1); + + #Prevent losing guarantor data if error occurs + my @new_guarantors; + my @new_guarantor_id = $input->multi_param('new_guarantor_id'); + my @new_guarantor_relationship = $input->multi_param('new_guarantor_relationship'); + foreach my $gid ( @new_guarantor_id ) { + my $patron = Koha::Patrons->find( $gid ); + my $relationship = shift( @new_guarantor_relationship ); + next unless $patron; + my $g = { patron => $patron, relationship => $relationship }; + push( @new_guarantors, $g ); + } + $template->param( new_guarantors => \@new_guarantors ); } #Formatting data for display --