From ed247c4665b88fb123b196ec7811a9852bd604ab 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. --- 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 b60e7fa74c7..8d5bd35d28c 100755 --- a/misc/cronjobs/process_message_queue.pl +++ b/misc/cronjobs/process_message_queue.pl @@ -78,6 +78,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 { @@ -91,7 +95,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( -- 2.52.0