Bug 28052: Do not check SYSENV values only keys in loop
authorColin Campbell <colin.campbell@ptfs-europe.com>
Tue, 30 Mar 2021 11:13:27 +0000 (12:13 +0100)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Thu, 1 Apr 2021 16:51:37 +0000 (18:51 +0200)
commitcd40febe67b4d75e57311ff1673d0c34299b58fe
tree4f6ed0c648ca4461f35350bff399764942359bc7
parent607d7f0a60d8c002dbac7ce22e7bcc128062f208
Bug 28052: Do not check SYSENV values only keys in loop

Loop is only interested in key values, because 'keys' is omitted
it is checking values as well. This can lead to misleading errors
being logged (e.g. key is undefined)
Extract keys only to loop array as in the other loops below this

Testing:
1 - tail /var/lib/koha/kohadev/sip-output.log
2 - in another tab use the sip cli tester:
   perl misc/sip_cli_emulator.pl -a localhost -p 6001 -su term1 -sp term1 -l CPL -m checkin --item CHESS1
3 - Note errors:
Use of uninitialized value $key in index at /kohadevbox/koha/C4/SIP/Sip/MsgType.pm line 337, <STDIN> line 1.
Use of uninitialized value $key in index at /kohadevbox/koha/C4/SIP/Sip/MsgType.pm line 337, <STDIN> line 2.
4 - Apply patch and restart all the things
5 - Repeat 2
6 - Errors mentioned are gone

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
C4/SIP/Sip/MsgType.pm