@@ -, +, @@ ---- ---- ---- --- members/memberentry.pl | 7 +++++++ 1 file changed, 7 insertions(+) --- a/members/memberentry.pl +++ a/members/memberentry.pl @@ -531,6 +531,13 @@ if ((!$nok) and $nodouble and ($op eq 'insert' or $op eq 'save')){ $newdata{debarredcomment} = $newdata{debarred_comment}; delete $newdata{debarred_comment}; delete $newdata{password2}; + + #If changing to a patron category whose category type is not child then remove guarantor id + my $borrowercategory = Koha::Patron::Categories->find($newdata{categorycode}); + if (( $borrowercategory->category_type ne 'C' ) && ( $borrowercategory->category_type ne 'P' )) { + $newdata{guarantorid} = ''; + } + $patron->set(\%newdata)->store if scalar(keys %newdata) > 1; # bug 4508 - avoid crash if we're not # updating any columns in the borrowers table, # which can happen if we're only editing the --