From 3f598a34607ab6b20cbf608860199350c4f1f775 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 --- 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 dbd2703c44d..99400e6f69a 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