From d04c29c0b9f72cec55d4cabaa4286e004f82d49a Mon Sep 17 00:00:00 2001 From: Baptiste Wojtkowski Date: Wed, 10 Jul 2024 17:19:14 +0200 Subject: [PATCH] Bug 18086: Fix the behaviour of GetOverdueMessageTransportTypes See https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18086#c27 for more context : This addresses the second point of this comment. Test concerning GetOverdueMessageTransportTypes were not passing anymore after previous patch. This was due to the behaviour of Koha::Overdue->get_message_types which returns all messages from a rule id, not taking into account the letternumber when considering a OverdueRule (which is totally normal). I fixed the join in GetOverdueMessageTransportTypes to return directly the desired column and use it in the rest of the code Note: Koha::Overdue->get_message_types might not be necessary anymore --- C4/Overdues.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/C4/Overdues.pm b/C4/Overdues.pm index b6943cb..fec0fd4 100644 --- a/C4/Overdues.pm +++ b/C4/Overdues.pm @@ -779,12 +779,13 @@ sub GetOverdueMessageTransportTypes { }, { join => 'overduerules_transport_types', + '+select' => ['overduerules_transport_types.message_transport_type'], + '+as' => ['message_transport_type'], } - )->next; + ); return [] unless $rule; - my $transport_types = $rule->transport_types; my @mtts; while ( my $current_rule = $rule->next ) { push @mtts, $current_rule->get_column('message_transport_type'); -- 2.43.0