From 83f97a4a2327c758638a1bf695d597a810b13ea1 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 --- members/memberentry.pl | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/members/memberentry.pl b/members/memberentry.pl index 6e35614268f..61df70ba7b3 100755 --- a/members/memberentry.pl +++ b/members/memberentry.pl @@ -572,13 +572,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++ ) { @@ -610,23 +612,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 (Apple Git-154)