From 6132f9708d6c7b8da006cf7f2d12eb2e469a58a5 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Fri, 30 Sep 2022 12:32:25 +0000 Subject: [PATCH] Bug 27265: (follow-up) Use existing parameter Signed-off-by: Marcel de Rooy Signed-off-by: Tomas Cohen Arazi (cherry picked from commit a39ecfd7f766be77d92d0054364ecda65942d2ec) Signed-off-by: Lucas Gass --- C4/Letters.pm | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/C4/Letters.pm b/C4/Letters.pm index e47c4741b1..6b19fc7252 100644 --- a/C4/Letters.pm +++ b/C4/Letters.pm @@ -971,7 +971,7 @@ sub SendQueuedMessages { 'limit' => $params->{'limit'} // 0, 'borrowernumber' => $params->{'borrowernumber'} // q{}, 'letter_code' => $params->{'letter_code'} // q{}, - 'type' => $params->{'type'} // q{}, + 'message_transport_type' => $params->{'type'} // q{}, }; my $unsent_messages = _get_unsent_messages( $which_unsent_messages ); MESSAGE: foreach my $message ( @$unsent_messages ) { @@ -1251,10 +1251,6 @@ sub _get_unsent_messages { my @query_params = ('pending'); if ( ref $params ) { - if ( $params->{'message_transport_type'} ) { - $statement .= ' AND mq.message_transport_type = ? '; - push @query_params, $params->{'message_transport_type'}; - } if ( $params->{'borrowernumber'} ) { $statement .= ' AND mq.borrowernumber = ? '; push @query_params, $params->{'borrowernumber'}; @@ -1267,8 +1263,8 @@ sub _get_unsent_messages { push @query_params, @letter_codes; } } - if ( $params->{'type'} ) { - my @types = ref $params->{'type'} eq "ARRAY" ? @{$params->{'type'}} : $params->{'type'}; + if ( $params->{'message_transport_type'} ) { + my @types = ref $params->{'message_transport_type'} eq "ARRAY" ? @{$params->{'message_transport_type'}} : $params->{'message_transport_type'}; if ( @types ) { my $q = join( ",", ("?") x @types ); $statement .= " AND message_transport_type IN ( $q ) "; -- 2.39.5