[Koha-bugs] [Bug 24966] Fix calls to maybe_add where method call does not return a value

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Tue Mar 24 13:54:14 CET 2020


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24966

--- Comment #1 from Kyle M Hall <kyle at bywatersolutions.com> ---
Created attachment 101559
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=101559&action=edit
Bug 24966: Fix calls to maybe_add where method call does not return a value

For reasons unknown to me, a call like:
--
$resp .= maybe_add( FID_CALL_NUMBER, $item->call_number, $server );
--
will not work as expected if the item has no callnumber.

One would expect the parameters to the subroutine to be: 'CY', under, and a
SIPServer object.

What is actually received is: 'CY', and a SIPServer object.

We ingest the parameters like so:
--
sub maybe_add {
    my ($fid, $value, $server) = @_;
--
So, what happens is $value is populated with the server object!

This can cause bad output like this:
--
OUTPUT MSG: '101YNN20200324    063701AOBPL|AB32503201584185|AQBPL|AJCat
/|CK001|CRn|CSJ 636.8
CLU|CYC4::SIP::SIPServer=HASH(0x1ea0e58)|DAC4::SIP::SIPServer=HASH(0x1ea0e58)|'
--

Test Plan:
1) On master, perform a checkin of an item not on hold using the sip cli tester
2) Note some fields contain something like 'C4::SIP::SIPServer=HASH(0x1ea0e58)'
3) Apply this patch
4) Restart the SIP server
5) Perform the SIP checkin again
6) Those fields from step 2 should be gone!

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list