[Koha-bugs] [Bug 27265] Process message queue cron should be able to take multiple types as a parameter

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Sep 30 11:12:05 CEST 2022


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=27265

--- Comment #15 from Marcel de Rooy <m.de.rooy at rijksmuseum.nl> ---
At scope borders:

sub SendQueuedMessages 
    my $which_unsent_messages  = {
        'message_id'     => $params->{'message_id'},
        'limit'          => $params->{'limit'} // 0,
        'borrowernumber' => $params->{'borrowernumber'} // q{},
        'letter_code'    => $params->{'letter_code'} // q{},
        'type'           => $params->{'type'} // q{},
 my $unsent_messages = _get_unsent_messages( $which_unsent_messages );

The POD of the following sub does not mention the undocumented 'type'
sub _get_unsent_messages {

        if ( $params->{'message_transport_type'} ) {
            $statement .= ' AND mq.message_transport_type = ? ';
            push @query_params, $params->{'message_transport_type'};
        }
AND
        if ( $params->{'type'} ) {
            my @types = ref $params->{'type'} eq "ARRAY" ? @{$params->{'type'}}
: $params->{'type'};
            if ( @types ) {
                my $q = join( ",", ("?") x @types );
                $statement .= " AND message_transport_type IN ( $q ) ";
                push @query_params, @types;
            }
        }

We could better use one parameter and use the one mentioned in POD.

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list