From 9f913aeb5014376fccac301c1659847664d5cee1 Mon Sep 17 00:00:00 2001 From: Pedro Amorim Date: Mon, 19 Feb 2024 16:18:33 +0000 Subject: [PATCH] Bug 36118: Send patron object to template Sponsored-by: UKHSA - UK Health Security Agency Sponsored-by: PTFS Europe Ltd Signed-off-by: Victor Grousset/tuxayo Signed-off-by: Pedro Amorim Signed-off-by: Jeremy Evans Signed-off-by: Katrin Fischer --- Koha/ILL/Request/Logger.pm | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/Koha/ILL/Request/Logger.pm b/Koha/ILL/Request/Logger.pm index dbd2703c44..99400e6f69 100644 --- a/Koha/ILL/Request/Logger.pm +++ b/Koha/ILL/Request/Logger.pm @@ -26,6 +26,7 @@ use C4::Templates; use C4::Log qw( logaction ); use Koha::ActionLogs; use Koha::Notice::Template; +use Koha::Patrons; =head1 NAME @@ -257,15 +258,18 @@ sub get_request_logs { foreach my $alias(@{$aliases}) { $alias_hash->{$alias->{authorised_value}} = $alias; } - foreach my $log(@{$logs}) { + foreach my $log ( @{$logs} ) { + $log->{patron} = Koha::Patrons->find( $log->{user} ); $log->{notice_types} = $notice_hash; - $log->{aliases} = $alias_hash; - $log->{info} = from_json($log->{info}); - $log->{template} = $self->get_log_template({ - request => $request, - origin => $log->{info}->{log_origin}, - action => $log->{action} - }); + $log->{aliases} = $alias_hash; + $log->{info} = from_json( $log->{info} ); + $log->{template} = $self->get_log_template( + { + request => $request, + origin => $log->{info}->{log_origin}, + action => $log->{action} + } + ); } return $logs; -- 2.39.5