From 461a9fef62c42e2800fceb637b43e63878e28505 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 8 Jan 2018 11:16:09 -0300 Subject: [PATCH] Bug 19935: Replace GetPendingIssues - deletemem.pl Same as previously, we just want Koha::Patron->checkouts->count to know if a patron has checkouts. Test plan: Confirm that you cannot delete a patron's card if they have pending checkouts --- members/deletemem.pl | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/members/deletemem.pl b/members/deletemem.pl index 57cecae8ab..27867ed436 100755 --- a/members/deletemem.pl +++ b/members/deletemem.pl @@ -74,15 +74,11 @@ 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 $countissues = $patron->pending_checkouts->count; 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.11.0