From 58dccaee26181b42ab3a435e4b84786e3a75bcd3 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Fri, 2 Mar 2018 06:08:10 -0500 Subject: [PATCH] Bug 19933: Move instantiation of in deletemem.pl Signed-off-by: Kyle M Hall Signed-off-by: Josef Moravec Signed-off-by: Jonathan Druart --- members/deletemem.pl | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/members/deletemem.pl b/members/deletemem.pl index 7bd8e02553..96f6251753 100755 --- a/members/deletemem.pl +++ b/members/deletemem.pl @@ -57,6 +57,7 @@ if ( $loggedinuser == $member ) { } my $logged_in_user = Koha::Patrons->find( $loggedinuser ) or die "Not logged in"; +my $patron = Koha::Patrons->find( $member ); output_and_exit_if_error( $input, $cookie, $template, { module => 'members', logged_in_user => $logged_in_user, current_patron => $patron } ); # Handle deletion from the Norwegian national patron database, if it is enabled @@ -76,12 +77,9 @@ if ( C4::Context->preference('NorwegianPatronDBEnable') && C4::Context->preferen my $issues = GetPendingIssues($member); # FIXME: wasteful call when really, we only want the count my $countissues = scalar(@$issues); -my $patron = Koha::Patrons->find( $member ); my $charges = $patron->account->non_issues_charges; my $userenv = C4::Context->userenv; - - if ($patron->category->category_type eq "S") { unless(C4::Auth::haspermission($userenv->{'id'},{'staffaccess'=>1})) { print $input->redirect("/cgi-bin/koha/members/moremember.pl?borrowernumber=$member&error=CANT_DELETE_STAFF"); -- 2.39.5