Bug 8113 - Item return fails using SIP2
Summary: Item return fails using SIP2
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: SIP2 (show other bugs)
Version: 3.8
Hardware: PC Linux
: P3 major (vote)
Assignee: Colin Campbell
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-05-17 20:54 UTC by Ron Gillies
Modified: 2014-12-07 20:02 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ron Gillies 2012-05-17 20:54:59 UTC
I have been testing Koha's SIP2 service using both the 3M software and an actual self-check device.

When attempting to return an item loaned using the Koha circulation interface through the 3m software I receive a message that communications has failed while the following message appears in my sip.err file:

Use of uninitialized value $var in hash element at /usr/share/koha/lib/C4/Context.pm line 1026

Undefined subroutine &C4::Circulation::GetItemnumberFromBarcode called at /usr/share/koha/lib/C4/Circulation.pm line 1541

Note that this error is similar to the one reported in bug 7684 today
Comment 1 Chris Cormack 2012-05-17 20:59:35 UTC
This is only triggered if the item needs to be transferred, so will be sporadic. But can be reliably recreated on by returning an item that needs to be transferred.
Comment 2 Ron Gillies 2012-05-17 21:02:42 UTC
(In reply to comment #1)
> This is only triggered if the item needs to be transferred, so will be
> sporadic. But can be reliably recreated on by returning an item that needs
> to be transferred.

Odd as the item was from branch MAIN and was being returned to branch MAIN -- no other branches currently defined on my test system (and only a small number <25) of items
Comment 3 Chris Cormack 2012-05-17 21:09:03 UTC
I have a suspicion this is to do with bug 6875, but I have to go to a user day now so can't investigate more.

And it may be checking if it needs transfer. A quick fix ron, change line 1541 to read 

   my $itemnumber = C4::Items::GetItemnumberFromBarcode( $barcode );

instead of

   my $itemnumber = GetItemnumberFromBarcode( $barcode );

This will work while we track down the root cause and fix it
Comment 4 Ron Gillies 2012-05-17 23:10:52 UTC
(In reply to comment #3)
> I have a suspicion this is to do with bug 6875, but I have to go to a user
> day now so can't investigate more.
> 
> And it may be checking if it needs transfer. A quick fix ron, change line
> 1541 to read 
> 
>    my $itemnumber = C4::Items::GetItemnumberFromBarcode( $barcode );
> 
> instead of
> 
>    my $itemnumber = GetItemnumberFromBarcode( $barcode );
> 
> This will work while we track down the root cause and fix it

Made the change that you suggested at line 1541

Error continues with a slight change in the location

Undefined subroutine &C4::Circulation::GetItemnumberFromBarcode called at /usr/share/koha/lib/C4/Circulation.pm line 1563

GetItem is used at that point and a note references the fact that it should work because GetItemnumberFromBarcode worked

I will leave this as is for the moment as it may need eyes more familiar with the code than mine.
Comment 5 Mark Tompsett 2012-09-27 04:54:09 UTC
That should be C4::Items->GetItemnumberFromBarcode not C4::Items::GetItemnumberFromBarcode

The latter expects a GetItemnumberFromBarcode.pm file, whereas the former expects a function inside of C4::Items.
Comment 6 Chris Cormack 2012-09-27 04:58:42 UTC
(In reply to comment #5)
> That should be C4::Items->GetItemnumberFromBarcode not
> C4::Items::GetItemnumberFromBarcode
> 
> The latter expects a GetItemnumberFromBarcode.pm file, whereas the former
> expects a function inside of C4::Items.

Not true. C4::Items::GetItemnumberFromBarcode() calls the GetItemnumberFromBarcode subroutine in C4/Items.pm

If you notice Ron's other comment, it is now the same error further in the file.
Comment 7 Bilgi Küflü 2013-01-07 16:21:56 UTC
Anybody has a solution for this bug?? I am experiencing the same error even at Checkout/CheckIn. The connection is closed with the same error :

Use of uninitialized value $var in hash element at /home/koha/kohaclone/C4/Context.pm line 1026

Undefined subroutine &C4::Circulation::GetItemnumberFromBarcode called at /home/koha/kohaclone/C4/Circulation.pm line 1541
Comment 8 Bilgi Küflü 2013-01-07 17:26:00 UTC
Sorry the line number is wrong on my previous mail. The correct one is 

Undefined subroutine &C4::Circulation::GetItemnumberFromBarcode called at /home/koha/kohaclone/C4/Circulation.pm line 671
Comment 9 Katrin Fischer 2013-01-24 22:12:01 UTC
Hm, this does not sound like a nice bug - I still haven't figured out how to test SIP properly, can someone else take a look maybe?
Comment 10 Colin Campbell 2013-01-25 09:06:46 UTC
The call does not occur in current versions of C4::Circulation.pm is this specific to a particular release of 3.8 ? Can someone who can reproduce this try with a later release
Comment 11 Katrin Fischer 2013-01-25 09:07:39 UTC
Thx Colin.
Comment 12 Chris Cormack 2014-03-12 20:01:48 UTC
Fixed in later versions