diff --git a/circ/circulation.pl b/circ/circulation.pl
index e51ed2efc4..ded56c4a33 100755
--- a/circ/circulation.pl
+++ b/circ/circulation.pl
@@ -566,7 +566,7 @@ if ( $borrowernumber && $borrower->{'category_type'} eq 'C') {
$template->param( 'catcode' => $patron_categories->next ) if $patron_categories->count == 1;
}
-my $all_messages = Koha::Patron::Messages->search(
+my $messages = Koha::Patron::Messages->search(
{
'me.borrowernumber' => $borrowernumber,
},
@@ -577,22 +577,6 @@ my $all_messages = Koha::Patron::Messages->search(
}
);
-my @messages;
-while ( my $content = $all_messages->next ) {
- my $this_item;
-
- $this_item->{borrowernumber} = $content->borrowernumber;
- $this_item->{message_id} = $content->message_id;
- $this_item->{branchcode} = $content->branchcode;
- $this_item->{message_type} = $content->message_type;
- $this_item->{message_date} = $content->message_date;
- $this_item->{message} = $content->message;
- $this_item->{manager_id} = $content->manager_id;
- $this_item->{name} = $content->_result->get_column('manager_firstname') . ' ' . $content->_result->get_column('manager_surname');
-
- push @messages, $this_item;
-}
-
my $fast_cataloging = 0;
if ( Koha::BiblioFrameworks->find('FA') ) {
$fast_cataloging = 1
@@ -642,7 +626,7 @@ if ($restoreduedatespec || $stickyduedate) {
$template->param(
patron => $patron,
- messages => \@messages,
+ messages => $messages,
borrower => $borrower,
borrowernumber => $borrowernumber,
categoryname => $borrower->{'description'},
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt
index eab3ef2aa1..d8d2943763 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt
@@ -859,7 +859,7 @@ No patron matched [% message | html %]
[% END %]>
[% message.message_date | $KohaDates %]
[% Branches.GetName( message.branchcode ) %]
- ( [% message.name %] )
+ ( [% message.get_column('manager_firstname') %] [% message.get_column('manager_surname') %] )
"[% message.message %]"
[% IF message.branchcode == branch OR Koha.Preference('AllowAllMessageDeletion') %]