From 32be09a3a450af7369cc81ac9c6165478f109a34 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 Signed-off-by: Victor Grousset/tuxayo --- Koha/Illrequest/Logger.pm | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/Koha/Illrequest/Logger.pm b/Koha/Illrequest/Logger.pm index 6aff15765d..c6c0ad74e3 100644 --- a/Koha/Illrequest/Logger.pm +++ b/Koha/Illrequest/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.44.0