From 056abc53217e081d36119b2efb2e1f96de4a69f5 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Fri, 18 Oct 2024 10:31:32 +0000 Subject: [PATCH] Bug 35508: (QA follow-up) Fix qa script issues Signed-off-by: Kyle M Hall Signed-off-by: Katrin Fischer --- members/memberentry.pl | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/members/memberentry.pl b/members/memberentry.pl index c5114c664c..284bbd82d0 100755 --- a/members/memberentry.pl +++ b/members/memberentry.pl @@ -590,13 +590,15 @@ if ((!$nok) and $nodouble and ($op eq 'cud-insert' or $op eq 'cud-save')){ } } - if ( $success ) { - if (C4::Context->preference('ExtendedPatronAttributes') and $input->param('setting_extended_patron_attributes')) { + if ($success) { + if ( C4::Context->preference('ExtendedPatronAttributes') + and $input->param('setting_extended_patron_attributes') ) + { my $existing_attributes = $patron->extended_attributes->filter_by_branch_limitations->unblessed; my $needs_update = 1; - # If there are an unqueunal number of new and old patron attributes they definietely need updated + # If there are an unqueunal number of new and old patron attributes they definitely need updated if ( scalar @{$existing_attributes} == scalar @{$extended_patron_attributes} ) { my $seen = 0; for ( my $i = 0 ; $i <= scalar @{$extended_patron_attributes} ; $i++ ) { @@ -628,23 +630,27 @@ if ((!$nok) and $nodouble and ($op eq 'cud-insert' or $op eq 'cud-save')){ } } - if ($needs_update) { - $patron->extended_attributes->filter_by_branch_limitations->delete; - $patron->extended_attributes($extended_patron_attributes); - } + if ($needs_update) { + $patron->extended_attributes->filter_by_branch_limitations->delete; + $patron->extended_attributes($extended_patron_attributes); } + } - if ( $destination eq 'circ' and not C4::Auth::haspermission( C4::Context->userenv->{id}, { circulate => 'circulate_remaining_permissions' } ) ) { + if ( + $destination eq 'circ' + and not C4::Auth::haspermission( + C4::Context->userenv->{id}, + { circulate => 'circulate_remaining_permissions' } + ) + ) + { # If we want to redirect to circulation.pl and need to check if the logged in user has the necessary permission $destination = 'not_circ'; } print scalar( $destination eq "circ" ) - ? $input->redirect( - "/cgi-bin/koha/circ/circulation.pl?borrowernumber=$borrowernumber") - : $input->redirect( - "/cgi-bin/koha/members/moremember.pl?borrowernumber=$borrowernumber" - ); - exit; # You can only send 1 redirect! After that, content or other headers don't matter. + ? $input->redirect("/cgi-bin/koha/circ/circulation.pl?borrowernumber=$borrowernumber") + : $input->redirect("/cgi-bin/koha/members/moremember.pl?borrowernumber=$borrowernumber"); + exit; # You can only send 1 redirect! After that, content or other headers don't matter. } } -- 2.39.5