From e12b3d16157920760acbc3b454d1058221d84ff5 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 6 Mar 2014 15:18:12 +0100 Subject: [PATCH] Bug 9016: FIX GetLetters should return all letters GetLetters only returns letters with a mtt = email. It should return all letter codes in the DB. The message_transport_type parameter is never used. To reproduce the issue: Create a notice with a sms template and no email template. Go on the overdue rules configucation page. The notice does not appear in the notice list. Signed-off-by: Olli-Antti Kivilahti --------------- Testing report: --------------- Testing this subroutine from a test stub. Calling the method without arguments and with argument 'circulation' and 'circulat'. Works as supposed to. Related Bug 11931 discovered but not within the scope of this featureset. Signed-off-by: Marcel de Rooy --- C4/Letters.pm | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/C4/Letters.pm b/C4/Letters.pm index 51020b6..7b55762 100644 --- a/C4/Letters.pm +++ b/C4/Letters.pm @@ -98,18 +98,17 @@ $template->param(LETTERLOOP => \@letterloop); sub GetLetters { # returns a reference to a hash of references to ALL letters... - my ( $cat, $message_transport_type ) = @_; - $message_transport_type ||= 'email'; + my ( $cat ) = @_; my %letters; my $dbh = C4::Context->dbh; my $sth; my $query = q{ - SELECT * FROM letter WHERE + SELECT * FROM letter WHERE 1 }; - $query .= q{ module = ? AND } if defined $cat; - $query .= q{ message_transport_type = ? ORDER BY name}; + $query .= q{ AND module = ? } if defined $cat; + $query .= q{ GROUP BY code ORDER BY name}; $sth = $dbh->prepare($query); - $sth->execute((defined $cat ? $cat : ()), $message_transport_type); + $sth->execute((defined $cat ? $cat : ())); while ( my $letter = $sth->fetchrow_hashref ) { $letters{ $letter->{'code'} } = $letter->{'name'}; -- 1.7.10.4