From d1744b4e09f3e6722e1f69e9ea8b49deb9fc4b3c Mon Sep 17 00:00:00 2001 From: Colin Campbell Date: Wed, 21 Oct 2009 09:54:18 +0100 Subject: [PATCH] LP#1180479: Koha Bug 3723: Correct return of Institution in Patron Info Resp While the comment correctly notes that the order of variable length fields is not fixed some units expect mandatory fields to follow the sequence in the protocol definition and fail parsing otherwise. Moved institution id to its expected place in the patron information response. Signed-off-by: Galen Charlton Signed-off-by: Galen Charlton Conflicts: Sip/MsgType.pm Signed-off-by: Galen Charlton --- Sip/MsgType.pm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Sip/MsgType.pm b/Sip/MsgType.pm index 4892ca1..1c4b080 100644 --- a/Sip/MsgType.pm +++ b/Sip/MsgType.pm @@ -944,6 +944,8 @@ sub handle_patron_info { $resp .= add_count('patron_info/recall_items', scalar @{$patron->recall_items(undef,undef,1) }); $resp .= add_count('patron_info/unavail_holds', scalar @{$patron->unavail_holds(undef,undef,1)}); + $resp .= add_field(FID_INST_ID, $server->{ils}->institution); + # while the patron ID we got from the SC is valid, let's # use the one returned from the ILS, just in case... $resp .= add_field(FID_PATRON_ID, $patron->id); @@ -1009,19 +1011,18 @@ sub handle_patron_info { # no personal name, and is invalid (if we're using 2.00) $resp .= 'YYYY' . (' ' x 10) . $lang . Sip::timestamp(); $resp .= '0000' x 6; - $resp .= add_field(FID_PERSONAL_NAME, ''); + $resp .= add_field(FID_INST_ID, $server->{ils}->institution); # the patron ID is invalid, but it's a required field, so # just echo it back $resp .= add_field(FID_PATRON_ID, $fields->{(FID_PATRON_ID)}); + $resp .= add_field(FID_PERSONAL_NAME, ''); if ($protocol_version >= 2) { $resp .= add_field(FID_VALID_PATRON, 'N'); } } - $resp .= add_field(FID_INST_ID, $server->{ils}->institution); - $self->write_msg($resp); return(PATRON_INFO); -- 2.11.0