Browse Source

Bug 27589: Access item fields as hash

SIP item stores the item unblessed so field must be accessed as a hashref

This patch changes the code in handle_item_information to match the code in
handle_checkin

To test:
1 - In sip config set the cr_item_field='itype' for a sip account
2 - Restart SIP
3 - Attempt an item information requests using the sip_cli_emulator
     perl misc/sip_cli_emulator.pl -a localhost -p 6001 -su term1 -sp term1 -l CPL -m item_information --item 39999000011791
4 - It fails!
5 - Apply patch and restart
6 - It succeeds!

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
21.05.x
Nick Clemens 3 years ago
committed by Jonathan Druart
parent
commit
18368d6a0c
  1. 2
      C4/SIP/Sip/MsgType.pm

2
C4/SIP/Sip/MsgType.pm

@ -1220,7 +1220,7 @@ sub handle_item_information {
$resp .= maybe_add( FID_ITEM_PROPS, $item->sip_item_properties, $server );
if ( my $CR = $server->{account}->{cr_item_field} ) {
$resp .= maybe_add( FID_COLLECTION_CODE, $item->$CR, $server );
$resp .= maybe_add( FID_COLLECTION_CODE, $item->{$CR}, $server );
} else {
$resp .= maybe_add( FID_COLLECTION_CODE, $item->collection_code, $server );
}

Loading…
Cancel
Save