From b92e9a21153ba0b569a0308b47e8a3133a663587 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 12 Dec 2023 17:03:58 +0100 Subject: [PATCH] Bug 34478: Manual fix - memberentry (modify) Signed-off-by: Jonathan Druart --- members/memberentry.pl | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/members/memberentry.pl b/members/memberentry.pl index 8ddceacca9..8163953891 100755 --- a/members/memberentry.pl +++ b/members/memberentry.pl @@ -74,7 +74,7 @@ if ( C4::Context->preference('SMSSendDriver') eq 'Email' ) { } my $actionType = $input->param('actionType') || ''; -my $modify = $input->param('cud-modify'); +my $modify = $input->param('modify'); my $delete = $input->param('cud-delete'); my $op = $input->param('op'); my $destination = $input->param('destination'); @@ -83,7 +83,7 @@ my $check_member = $input->param('check_member'); my $nodouble = $input->param('nodouble'); my $duplicate = $input->param('duplicate'); my $quickadd = $input->param('quickadd'); -$nodouble = 1 if ($op eq 'cud-modify' or $op eq 'duplicate'); # FIXME hack to represent fact that if we're +$nodouble = 1 if ($op eq 'modify' or $op eq 'duplicate'); # FIXME hack to represent fact that if we're # modifying an existing patron, it ipso facto # isn't a duplicate. Marking FIXME because this # script needs to be refactored. @@ -167,7 +167,7 @@ $template->param( "cud-add" => 1 ) if ( $op eq 'cud-add' ); $template->param( "quickadd" => 1 ) if ( $quickadd ); $template->param( "duplicate" => 1 ) if ( $op eq 'duplicate' ); $template->param( "checked" => 1 ) if ( defined($nodouble) && $nodouble eq 1 ); -if ( $op eq 'cud-modify' or $op eq 'cud-save' or $op eq 'duplicate' ) { +if ( $op eq 'modify' or $op eq 'cud-save' or $op eq 'duplicate' ) { my $logged_in_user = Koha::Patrons->find( $loggedinuser ); output_and_exit_if_error( $input, $cookie, $template, { module => 'members', logged_in_user => $logged_in_user, current_patron => $patron } ); @@ -191,7 +191,7 @@ $template->param( patron_category => $category ); # initialize %newdata my %newdata; # comes from $input->param() -if ( $op eq 'cud-insert' || $op eq 'cud-modify' || $op eq 'cud-save' || $op eq 'duplicate' ) { +if ( $op eq 'cud-insert' || $op eq 'modify' || $op eq 'cud-save' || $op eq 'duplicate' ) { my @names = ( $borrower_data && $op ne 'cud-save' ) ? keys %$borrower_data : $input->param(); foreach my $key (@names) { if (defined $input->param($key)) { @@ -400,7 +400,7 @@ elsif ( $borrowernumber ) { $extended_patron_attributes = Koha::Patrons->find($borrowernumber)->extended_attributes->unblessed; } -if ( ($op eq 'cud-modify' || $op eq 'cud-insert' || $op eq 'cud-save'|| $op eq 'duplicate') and ($step == 0 or $step == 3 )){ +if ( ($op eq 'modify' || $op eq 'cud-insert' || $op eq 'cud-save'|| $op eq 'duplicate') and ($step == 0 or $step == 3 )){ unless ($newdata{'dateexpiry'}){ $newdata{'dateexpiry'} = $category->get_expiry_date( $newdata{dateenrolled} ) if $category; } @@ -527,7 +527,7 @@ if ((!$nok) and $nodouble and ($op eq 'cud-insert' or $op eq 'cud-save')){ warn "Patron modification failed! - $@"; # Maybe we must die instead of just warn push @messages, {error => 'error_on_update_patron'}; } - $op = "cud-modify"; + $op = "modify"; }; if ( $success ) { @@ -598,7 +598,7 @@ if ($delete){ if ($nok or !$nodouble){ $op="cud-add" if ($op eq "cud-insert"); - $op="cud-modify" if ($op eq "cud-save"); + $op="modify" if ($op eq "cud-save"); %data=%newdata; $template->param( updtype => ($op eq 'cud-add' ?'I':'M')); # used to check for $op eq "cud-insert"... but we just changed $op! unless ($step){ @@ -627,7 +627,7 @@ if ($op eq 'cud-add'){ } $template->param( updtype => 'I', step_1=>1, step_2=>1, step_3=>1, step_4=>1, step_5 => 1, step_6 => 1, step_7 => 1); } -if ($op eq "cud-modify") { +if ($op eq "modify") { $template->param( updtype => 'M',modify => 1 ); $template->param( step_1=>1, step_2=>1, step_3=>1, step_4=>1, step_5 => 1, step_6 => 1, step_7 => 1) unless $step; if ( $step == 4 ) { @@ -708,7 +708,7 @@ if (C4::Context->userenv && C4::Context->userenv->{'branch'}) { $userbranch = C4::Context->userenv->{'branch'}; } -if (defined ($data{'branchcode'}) and ( $op eq 'cud-modify' || $op eq 'duplicate' || ( $op eq 'cud-add' && $category->category_type eq 'C' ) )) { +if (defined ($data{'branchcode'}) and ( $op eq 'modify' || $op eq 'duplicate' || ( $op eq 'cud-add' && $category->category_type eq 'C' ) )) { $userbranch = $data{'branchcode'}; } $template->param( userbranch => $userbranch ); -- 2.39.5