From e6908ef0a72b0e9075963aacaaccd5ce1caf50b1 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Tue, 20 Jan 2026 13:00:28 +0000 Subject: [PATCH] Bug 40934: (follow-up) --code and --exclude-code should be mutually exclusive Both options were being accepted but only the last one in the command line was being applied. Now they are mutually exclusive like --category and --skip-category in longoverdue.pl. Signed-off-by: Nick Clemens Signed-off-by: Pedro Amorim --- misc/cronjobs/process_message_queue.pl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/misc/cronjobs/process_message_queue.pl b/misc/cronjobs/process_message_queue.pl index 8e7610a168..3d5ca291be 100755 --- a/misc/cronjobs/process_message_queue.pl +++ b/misc/cronjobs/process_message_queue.pl @@ -75,6 +75,10 @@ ENDUSAGE die $usage if $help; +if ( @letter_code && @exclude_letter_code ) { + die "The options --code and --exclude-code are mutually exclusive.\nUse one or the other.\n" . $usage; +} + my $script_handler = Koha::Script->new( { script => $0 } ); try { @@ -88,7 +92,7 @@ try { }; # Remove empty elements, see bug 37075 -@letter_code = grep { $_ ne q{} } @letter_code; +@letter_code = grep { $_ ne q{} } @letter_code; @exclude_letter_code = grep { $_ ne q{} } @exclude_letter_code; C4::Letters::SendQueuedMessages(