Bug 15305 - KOHA SIP2 checkout doesn't update of the item holding status
Summary: KOHA SIP2 checkout doesn't update of the item holding status
Status: CLOSED INVALID
Alias: None
Product: Koha
Classification: Unclassified
Component: SIP2 (show other bugs)
Version: 3.20
Hardware: PC Linux
: P5 - low normal (vote)
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-12-04 07:55 UTC by june
Modified: 2016-12-05 21:23 UTC (History)
5 users (show)

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


Attachments
KOHA_SIP2_Checkout (48.80 KB, image/png)
2015-12-04 07:55 UTC, june
Details

Note You need to log in before you can comment on or make changes to this bug.
Description june 2015-12-04 07:55:31 UTC
Created attachment 45410 [details]
KOHA_SIP2_Checkout

I am using KOHA version 3.20 and I am able to check out the item, but the item status is always showing Available. 

1) This is my checkout message:
11NN20151202    08062920151227    030629AOmylib|AAthida|ABB1246857|AC|

2) This is my institution policy in SIPconfig.xml.
<institution id="mylib" implementation="ILS" parms="">
        <policy checkin="true" renewal="true" checkout="true"
                status_update="true" offline="false" timeout="100"
                retries="5"/>
    </institution>

3) The first item is checked out by using SIP2 in the following screenshot.
Comment 1 Katrin Fischer 2015-12-06 21:36:42 UTC
Comment on attachment 45410 [details]
KOHA_SIP2_Checkout

It looks like this issue is caused by the fact that the items.onloan is not updated correctly with the due date, while the entry in the issues table is correct.
Comment 2 june 2015-12-07 08:08:29 UTC
(In reply to Katrin Fischer from comment #1)
> Comment on attachment 45410 [details]
> KOHA_SIP2_Checkout
> 
> It looks like this issue is caused by the fact that the items.onloan is not
> updated correctly with the due date, while the entry in the issues table is
> correct.

How can I solve to update the item.onloan correctly?
Comment 3 Mason James 2015-12-08 19:32:31 UTC
(In reply to Katrin Fischer from comment #1)
> Comment on attachment 45410 [details]
> KOHA_SIP2_Checkout
> 
> It looks like this issue is caused by the fact that the items.onloan is not
> updated correctly with the due date, while the entry in the issues table is
> correct.

hi Katrin, did you confirm this bug, yourself?
Comment 4 Katrin Fischer 2015-12-08 23:12:50 UTC
Sorry, I didn't confirm via SIP - should have been more clear in my comment. We discussed it on IRC and came to the conclusion that this would cause the display we can see at the detail page - checked out and available at the same time. I think you will see the same as the screenshot, if you check out an item and then reset the items.onloan to null/empty.

We definitely still need to test and confirm this with SIP.
Comment 5 june 2015-12-09 03:02:05 UTC
I got this error for SIP checkout although the item has been successfully checked out and display available status at the detail page.

DBD::mysql::st execute failed: Cannot add or update a child row: a foreign key constraint fails (`koha_dev_koha`.`items`, CONSTRAINT `items_ibfk_3` FOREIGN KEY (`holdingbranch`) REFERENCES `branches` (`branchcode`) ON UPDATE CASCADE) at C4/Items.pm line 2384.
ERROR in _koha_modify_item UPDATE items SET issues=?,datelastborrowed=?,holdingbranch=?,itemlost_on=?,itemlost=?,onloan=? WHERE itemnumber=?: Cannot add or update a child row: a foreign key constraint fails (`koha_dev_koha`.`items`, CONSTRAINT `items_ibfk_3` FOREIGN KEY (`holdingbranch`) REFERENCES `branches` (`branchcode`) ON UPDATE CASCADE) at C4/Items.pm line 2387.
Comment 6 Mason James 2015-12-09 03:22:02 UTC
> We definitely still need to test and confirm this with SIP.

some good news... I issued an item via SIP, and the incorrect 'available' text was not shown. 

so 'works for me' on Koha-3.20.6
also, items.onloan column was correctly populated too
Comment 7 Mason James 2015-12-09 03:24:48 UTC
(In reply to june from comment #5)
> I got this error for SIP checkout although the item has been successfully
> checked out and display available status at the detail page.
> 
> DBD::mysql::st execute failed: Cannot add or update a child row: a foreign
> key constraint fails (`koha_dev_koha`.`items`, CONSTRAINT `items_ibfk_3`
> FOREIGN KEY (`holdingbranch`) REFERENCES `branches` (`branchcode`) ON UPDATE
> CASCADE) at C4/Items.pm line 2384.
> ERROR in _koha_modify_item UPDATE items SET
> issues=?,datelastborrowed=?,holdingbranch=?,itemlost_on=?,itemlost=?,
> onloan=? WHERE itemnumber=?: Cannot add or update a child row: a foreign key
> constraint fails (`koha_dev_koha`.`items`, CONSTRAINT `items_ibfk_3` FOREIGN
> KEY (`holdingbranch`) REFERENCES `branches` (`branchcode`) ON UPDATE
> CASCADE) at C4/Items.pm line 2387.

^... i think that error is caused by your item having a $branchcode that does not exist in the 'branches' table?
Comment 8 june 2015-12-09 03:40:21 UTC
It has branchecode.This are items and branches tables screenshot:

https://goo.gl/jFpnHz

https://goo.gl/GZOsFw
Comment 9 Katrin Fischer 2015-12-09 07:26:22 UTC
Hi Mason, thx for testing! I was worried about this one.

June, could you check 2 things in your installation?
- Make sure there is no space/whitespace after your branchcodes. It's a bit hard to see, but I had that happen and it was no fun :)
- Check your SIP configuration carefully - I think <institution id="mylib" should actually be your branchcode - <institution id="MK">.
Comment 10 june 2015-12-09 07:59:07 UTC
Hi Katrin,
I have checked 2 things. There is no whitespace in branchcodes. And , I have already changed <institution id="MK">.
But, It is still showing available status for checked out item.
Comment 11 Katrin Fischer 2015-12-09 08:15:13 UTC
Is the error still shown when you check out an item now? The one you copied from the log?
Comment 12 Liz Rea 2015-12-10 01:24:41 UTC
related to Bug 14673?
Comment 13 Liz Rea 2015-12-10 01:26:10 UTC
(possibly a red herring)
Comment 14 Liz Rea 2015-12-10 01:27:54 UTC
June,

Which minor version of Koha are you on (that's the 3rd number)?

Liz
Comment 15 june 2015-12-10 03:34:58 UTC
Hi Katrin and Mason,

Thanks. It has been solved after changing institution id and restart the server and SIP.

Hi Liz,

My KOHA version is 3.20.05.000
Comment 16 Katrin Fischer 2015-12-10 07:19:23 UTC
Hi June, thank you for the feedback, glad it works now. :)
Comment 17 Liz Rea 2015-12-10 20:41:45 UTC
Yay! Glad you're sorted. :)
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15305
bugs.koha-community.org
CC-MAIN-2024-26
44470
application/http; msgtype=response
sha1:EQNVRBNLM5SZGE66MYHDMKPDLCE7MQ25
<urn:uuid:c8f12cab-c9bc-4545-9af2-8ff0619d2a4c>
2024-06-23T07:37:44Z
72.14.190.217
text/html
sha1:LSDQTIELCQZM7XT3S5QG3JYP6XW3MTQP
<urn:uuid:70c0a052-bbad-4d81-9765-49613625e776>
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15305
response
<urn:uuid:6210b450-59e7-40be-a0bd-2f67d31234d8>
isPartOf: CC-MAIN-2024-26
publisher: Common Crawl
description: Wide crawl of the web for June 2024
operator: Common Crawl Admin (info@commoncrawl.org)
hostname: ip-10-67-67-225
software: Apache Nutch 1.20 (modified, https://github.com/commoncrawl/nutch/)
robots: checked via crawler-commons 1.5-SNAPSHOT (https://github.com/crawler-commons/crawler-commons)
format: WARC File Format 1.1
conformsTo: https://iipc.github.io/warc-specifications/specifications/warc-format/warc-1.1/