From: djfiander Date: Wed, 13 Jan 2010 01:39:30 +0000 (+0000) Subject: Dan Scott's patch: X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=5ace8f64f8ae2cd190ecdbf4e805a5d95560ab53;p=working%2FSIPServer.git Dan Scott's patch: Item status response 18 was returning CJ0|CM0| which are invalid according to the SIP2 specification; they should either be 18-char fixed fields or not there at all (as they're optional). It looks like it was just a reversed test. In looking through Sip/MsgType.pm in that area, I put together a patch which prevents those fields from being generated if the incoming value is 0 - and separates out the value assignment & test into separate statements, which should make the code a bit easier to read. As an aside, I believe the same problem was preventing the due date (AH) from being returned in the item status response. --- diff --git a/Sip/MsgType.pm b/Sip/MsgType.pm index 2fe926e..19d51e5 100644 --- a/Sip/MsgType.pm +++ b/Sip/MsgType.pm @@ -1129,22 +1129,27 @@ sub handle_item_information { $resp .= maybe_add(FID_CURRENT_LOCN, $item->current_location); $resp .= maybe_add(FID_ITEM_PROPS, $item->sip_item_properties); - if (($i = $item->fee) != 0) { + $i = $item->fee; + if ($i != 0) { $resp .= add_field(FID_CURRENCY, $item->fee_currency); $resp .= add_field(FID_FEE_AMT, $i); } $resp .= maybe_add(FID_OWNER, $item->owner); - if (($i = scalar @{$item->hold_queue}) > 0) { + $i = scalar @{$item->hold_queue}; + if ($i > 0) { $resp .= add_field(FID_HOLD_QUEUE_LEN, $i); } - if (!($i = $item->due_date)) { + $i = $item->due_date; + if ($i) { $resp .= add_field(FID_DUE_DATE, $i); } - if (!($i = $item->recall_date)) { + $i = $item->recall_date; + if ($i) { $resp .= add_field(FID_RECALL_DATE, $i); } - if (!($i = $item->hold_pickup_date)) { + $i = $item->hold_pickup_date; + if ($i) { $resp .= add_field(FID_HOLD_PICKUP_DATE, $i); }