[Koha-patches] [PATCH] Bug 3647 Fix to summary item fields in Patron Info Response

Colin Campbell colin.campbell at ptfs-europe.com
Fri Sep 18 19:15:56 CEST 2009


Item is a hash reference. We need to specify the field in
the hash to fill the data field not the hash itself.
Where no barcode field is present but we have an itemnumber
retrieve the item details to provide the barcode in
the hash to fill the data field not the hash itself.
---
 C4/SIP/Sip/MsgType.pm |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/C4/SIP/Sip/MsgType.pm b/C4/SIP/Sip/MsgType.pm
index 67ccc21..cbd1785 100644
--- a/C4/SIP/Sip/MsgType.pm
+++ b/C4/SIP/Sip/MsgType.pm
@@ -18,6 +18,7 @@ use Sip::Checksum qw(verify_cksum);
 use Data::Dumper;
 use CGI;
 use C4::Auth qw(&check_api_auth);
+use C4::Items qw(GetItem);
 
 use UNIVERSAL qw(can);	# make sure this is *after* C4 modules.
 
@@ -904,7 +905,11 @@ sub summary_info {
 
     syslog("LOG_DEBUG", "summary_info: list = (%s)", join(", ", @{$itemlist}));
     foreach my $i (@{$itemlist}) {
-        $resp .= add_field($fid, $i);
+        if (! $i->{barcode}  && $i->{itemnumber} ) {
+            my $item = GetItem($i->{itemnumber});
+            $i->{barcode} = $item->{barcode};
+        }
+        $resp .= add_field($fid, $i->{barcode});
     }
 
     return $resp;
-- 
1.6.2.5




More information about the Koha-patches mailing list