From c77722342df1068f12589a24b603b9d60d29bd41 Mon Sep 17 00:00:00 2001 From: Aleisha Amohia Date: Thu, 18 May 2017 23:10:13 +0000 Subject: [PATCH] Bug 18552: [16.11.X] Borrower debarments not showing on member detail page MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=utf-8 To test: 1) Go to a borrowers details page and create a manual restriction 2) Notice the restriction shows at the top of the page but the restriction tab says the member is currently unrestricted 3) Apply patch and refresh page 4) Restrictions tab should now correctly show debarments and correct number is shown 5) Confirming deleting and adding restrictions still works as expected Sponsored-by: Catalyst IT Followed test plan, works as expected Signed-off-by: Marc VĂ©ron Signed-off-by: Marcel de Rooy --- members/moremember.pl | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/members/moremember.pl b/members/moremember.pl index 98356f4..2d996ef 100755 --- a/members/moremember.pl +++ b/members/moremember.pl @@ -146,8 +146,13 @@ for (qw(gonenoaddress lost borrowernotes)) { $data->{$_} and $template->param(flagged => 1) and last; } -if ( Koha::Patrons->find( $borrowernumber )->is_debarred ) { - $template->param( 'userdebarred' => 1, 'flagged' => 1 ); +my $patron = Koha::Patrons->find( $borrowernumber ); +if ( $patron->is_debarred ) { + $template->param( + userdebarred => 1, + flagged => 1, + debarments => GetDebarments({ borrowernumber => $borrowernumber }), + ); my $debar = $data->{'debarred'}; if ( $debar ne "9999-12-31" ) { $template->param( 'userdebarreddate' => output_pref( { dt => dt_from_string( $debar ), dateonly => 1 } ) ); @@ -163,7 +168,6 @@ if ( $category_type eq 'C') { $template->param( 'catcode' => $patron_categories->next ) if $patron_categories->count == 1; } -my $patron = Koha::Patrons->find($data->{borrowernumber}); my @relatives; if ( my $guarantor = $patron->guarantor ) { $template->param( guarantor => $guarantor ); @@ -341,7 +345,6 @@ $template->param( AutoResumeSuspendedHolds => C4::Context->preference('AutoResumeSuspendedHolds'), SuspendHoldsIntranet => C4::Context->preference('SuspendHoldsIntranet'), RoutingSerials => C4::Context->preference('RoutingSerials'), - debarments => GetDebarments({ borrowernumber => $borrowernumber }), PatronsPerPage => C4::Context->preference("PatronsPerPage") || 20, relatives_issues_count => $relatives_issues_count, relatives_borrowernumbers => \@relatives, -- 2.1.4