Bug 37075

Summary: Message queue processor will fail to send any message unless letter_code is passed
Product: Koha Reporter: Kyle M Hall (khall) <kyle>
Component: Command-line UtilitiesAssignee: Kyle M Hall (khall) <kyle>
Status: Pushed to oldstable --- QA Contact: Martin Renvoize (ashimema) <martin.renvoize>
Severity: critical    
Priority: P5 - low CC: fridolin.somers, lucas, robin
Version: unspecified   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
24.11.00,24.05.06,23.11.11
Circulation function:
Bug Depends on: 21322    
Bug Blocks:    
Attachments: Bug 37075: Message queue processor will fail to send any message unless letter_code is passed
Bug 37075: Message queue processor will fail to send any message unless letter_code is passed
Bug 37075: Message queue processor will fail to send any message unless letter_code is passed

Description Kyle M Hall (khall) 2024-06-12 13:00:50 UTC
For reasons unknown, GetOptions is inserting an empty string into the letter_code list. If you are running the script with a letter code filter, the empty string is added to the OR so it functions. If no letter_code is passed, the search requires the letter code to be an empty string, which will of course fail. Even more perplexing is that this does not happen for the type list which is essentially identical code.
Comment 1 Kyle M Hall (khall) 2024-06-12 13:09:29 UTC
Created attachment 167655 [details] [review]
Bug 37075: Message queue processor will fail to send any message unless letter_code is passed

For reasons unknown, GetOptions is inserting an empty string into the letter_code list. If you are running the script with a letter code filter, the empty string is added to the OR so it functions. If no letter_code is passed, the search requires the letter code to be an empty string, which will of course fail. Even more perplexing is that this does not happen for the type list which is essentially identical code.

Test Plan:
1) Generate some messages in the message queue
2) Run `process_message_queue.pl -v -c`
3) Note nothing happens
4) Apply this patch
5) Repeat step 2
6) Messages are sent!
Comment 2 David Nind 2024-06-13 22:33:17 UTC
Created attachment 167704 [details] [review]
Bug 37075: Message queue processor will fail to send any message unless letter_code is passed

For reasons unknown, GetOptions is inserting an empty string into the letter_code list. If you are running the script with a letter code filter, the empty string is added to the OR so it functions. If no letter_code is passed, the search requires the letter code to be an empty string, which will of course fail. Even more perplexing is that this does not happen for the type list which is essentially identical code.

Test Plan:
1) Generate some messages in the message queue
2) Run `process_message_queue.pl -v -c`
3) Note nothing happens
4) Apply this patch
5) Repeat step 2
6) Messages are sent!

Signed-off-by: David Nind <david@davidnind.com>
Comment 3 Martin Renvoize (ashimema) 2024-06-14 10:45:17 UTC
Created attachment 167710 [details] [review]
Bug 37075: Message queue processor will fail to send any message unless letter_code is passed

For reasons unknown, GetOptions is inserting an empty string into the letter_code list. If you are running the script with a letter code filter, the empty string is added to the OR so it functions. If no letter_code is passed, the search requires the letter code to be an empty string, which will of course fail. Even more perplexing is that this does not happen for the type list which is essentially identical code.

Test Plan:
1) Generate some messages in the message queue
2) Run `process_message_queue.pl -v -c`
3) Note nothing happens
4) Apply this patch
5) Repeat step 2
6) Messages are sent!

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 4 Martin Renvoize (ashimema) 2024-06-14 10:49:41 UTC
Weird, but documented behaviour for GetOptions.

Passing QA
Comment 5 Katrin Fischer 2024-06-21 13:04:34 UTC
Pushed for 24.11!

Well done everyone, thank you!
Comment 6 Lucas Gass (lukeg) 2024-11-18 16:26:49 UTC
Backported to 24.05.x for upcoming 24.05.06
Comment 7 Fridolin Somers 2024-12-02 09:37:13 UTC
Pushed to 23.11.x for 23.11.11