diff --git a/members/memberentry.pl b/members/memberentry.pl index d40ee6885c..ed6df4b133 100755 --- a/members/memberentry.pl +++ b/members/memberentry.pl @@ -587,13 +587,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++ ) { @@ -625,23 +627,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. } }