Bug 40144

Summary: `sip_cli_emulator.pl` warnings
Product: Koha Reporter: Tomás Cohen Arazi (tcohen) <tomascohen>
Component: Command-line UtilitiesAssignee: Tomás Cohen Arazi (tcohen) <tomascohen>
Status: Pushed to main --- QA Contact: Marcel de Rooy <m.de.rooy>
Severity: minor    
Priority: P5 - low CC: david, lucas, m.de.rooy, robin, tomascohen
Version: MainKeywords: release-notes-needed
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39911
GIT URL: Change sponsored?: ---
Patch complexity: Trivial patch Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
25.11.00
Circulation function:
Attachments: Bug 40144: Get rid of `sip_cli_emulator.pl` warnings
Bug 40144: Get rid of `sip_cli_emulator.pl` warnings
Bug 40144: Get rid of `sip_cli_emulator.pl` warnings

Description Tomás Cohen Arazi (tcohen) 2025-06-13 18:17:04 UTC
Whiel debugging tests for 39911 I noticed a couple warnings that are useless (i.e. poor data handling instead of a feature alerting something).

The first patch on bug 39911 adds an explicit `die` to emulate a a crash. When running the `sip_cliemulator.pl` script some warnings showed up:

```shell
$ ./misc/sip_cli_emulator.pl -a 127.0.0.1 -p 6001 -su tcohen -sp tomasito -l MPL --patron tcohen -m patron_information
Attempting socket connection to 127.0.0.1:6001...connected!
Use of uninitialized value $hold_mode in string eq at ./misc/sip_cli_emulator.pl line 127.
SEND: 9300CNtcohen|COtomasito|CPMPL|
Use of uninitialized value $data in concatenation (.) or string at ./misc/sip_cli_emulator.pl line 359.
READ:
Use of uninitialized value $data in pattern match (m//) at ./misc/sip_cli_emulator.pl line 311.
Login Failed!
```
Comment 1 Tomás Cohen Arazi (tcohen) 2025-06-13 18:34:21 UTC
Created attachment 183248 [details] [review]
Bug 40144: Get rid of `sip_cli_emulator.pl` warnings

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 2 David Nind 2025-06-14 05:09:17 UTC
Created attachment 183253 [details] [review]
Bug 40144: Get rid of `sip_cli_emulator.pl` warnings

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Comment 3 David Nind 2025-06-14 05:13:17 UTC
Testing notes (using KTD):
1. Run ./misc/sip_cli_emulator.pl -a 127.0.0.1 -p 6001 -su tcohen -sp tomasito -l MPL --patron tcohen -m patron_information
2. Notice the "Use of unitialized value in...." in the output:
     Attempting socket connection to 127.0.0.1:6001...connected!
     Use of uninitialized value $hold_mode in string eq at ./misc/
       sip_cli_emulator.pl line 127.
     SEND: 9300CNtcohen|COtomasito|CPMPL|
     READ: 940

     Login Failed!
3. Apply the patch.
4. Repeat step 1.
5. Notice that there is now no "Use of unitialized value in...." in the output:
     Attempting socket connection to 127.0.0.1:6001...connected!
     SEND: 9300CNtcohen|COtomasito|CPMPL|
     READ: 940

     Login Failed!
Comment 4 Marcel de Rooy 2025-06-24 14:24:29 UTC
Created attachment 183462 [details] [review]
Bug 40144: Get rid of `sip_cli_emulator.pl` warnings

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 5 Lucas Gass (lukeg) 2025-06-24 21:26:56 UTC
Nice work everyone!

Pushed to main for 25.11