Bug 27265: (follow-up) Use existing parameter
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> (cherry picked from commita39ecfd7f7) Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> (cherry picked from commit6132f9708d) Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
This commit is contained in:
parent
5b37d0bb81
commit
31ee9c363c
|
|
@ -969,7 +969,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 ) {
|
||||
|
|
@ -1249,10 +1249,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'};
|
||||
|
|
@ -1265,8 +1261,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 ) ";
|
||||
|
|
|
|||
Loading…
Reference in New Issue