Summary: | SIP server always sets the alert flag when item not returned | ||
---|---|---|---|
Product: | Koha | Reporter: | Kyle M Hall (khall) <kyle> |
Component: | SIP2 | Assignee: | David Cook <dcook> |
Status: | CLOSED FIXED | QA Contact: | Marcel de Rooy <m.de.rooy> |
Severity: | minor | ||
Priority: | P5 - low | CC: | colin.campbell, dcook, jonathan.druart, m.de.rooy, martin.renvoize, mtj, nick, wizzyrea |
Version: | unspecified | ||
Hardware: | All | ||
OS: | All | ||
GIT URL: | Change sponsored?: | --- | |
Patch complexity: | Small patch | Documentation contact: | |
Documentation submission: | Text to go in the release notes: | ||
Version(s) released in: |
19.05.00, 18.11.06
|
Circulation function: | |
Bug Depends on: | 13411 | ||
Bug Blocks: | 23057 | ||
Attachments: |
Bug 15221 - SIP server always sets the alert flag when item not returned
Bug 15221: SIP server always sets the alert flag when item not returned Bug 15221: SIP server always sets the alert flag when item not returned Bug 15221: (QA follow-up) Fix Message.t |
Description
Kyle M Hall (khall)
2015-11-19 16:31:31 UTC
All of these responses have an alert type (CV) of 04 - 'ship to another branch', so the alert should be set I think I'm having the same issue? koha@9ec653ab82ce:~/koha$ perl ./misc/sip_cli_emulator.pl -l CPL -su staff -sp <password> --port=6001 --address=localhost --item test -m checkin --patron 51 Attempting socket connection to localhost:6001...connected! SEND: 9300CNstaff|COStaff1|CPCPL| READ: 941 Trying 'checkin' SEND: 09N20190520 07432920190520 074329APCPL|AOCPL|ABtest|ACStaff1|BIN| READ: 101YNY20190520 074329AOCPL|ABtest|AQCPL|AJTest| According to http://multimedia.3m.com/mws/media/355361O/sip2-protocol.pdf, that means the alarm bit is set. I'm using checked_in_ok="1" for my account login in SIPconfig.xml, so I'm not sure what's going on here... I don't have time to investigate this today but hopefully I'll take another look tomorrow... Still looking but I'm guessing that these are the problematic lines: my ($return, $messages, $issue, $borrower) = AddReturn($barcode, $branch, undef, undef, $return_date); $self->alert(!$return); Is it just me or does there appear to be next to no extant documentation on SIP2 extensions? The best I can find is: https://help.oclc.org/Library_Management/WorldShare_Circulation/Release_notes_and_known_issues/2019_WorldShare_Circulation_release_notes/095_WorldShare_Circulation_release_notes_March_2019 https://sourceforge.net/p/jsip2/wiki/Home/ According to http://multimedia.3m.com/mws/media/355361O/sip2-protocol.pdf, it seems like it's up to the ACS to decide when to raise an alert... Created attachment 89928 [details] [review] Bug 15221 - SIP server always sets the alert flag when item not returned The checked in response from the ACS always has the alert bit set to true, even when using the checked_in_ok option. This patch sets the alert bit to 0 when checked_in_ok is used and the item is checked in without a preceding checkout. To test: 0) Create patron in web interface with a cardnumber and userid of "staff" with a password that matches the account in SIPconfig.xml. Also set their branch to CPL (also matching SIPconfig.xml). 1) Create an item with a barcode of 'test' 2) Choose a patron to check out to and record their borrowernumber In one terminal: 3) cd to your git directory (e.g. /home/koha/koha) 4) perl ./C4/SIP/SIPServer.pm ~/koha-dev/etc/SIPconfig.xml In another terminal: 5) cd to your git directory (e.g. /home/koha/koha) 6) perl ./misc/sip_cli_emulator.pl -l CPL -su staff -sp <password> --port=6001 --address=localhost --item test -m checkin --patron <borrowernumber> NOTE: You need to replace <borrowernumber> with the borrowernumber from Step 2, and <password> with the password from Step 0. Before patch: koha@9ec653ab82ce:~/koha$ perl ./misc/sip_cli_emulator.pl -l CPL -su staff -sp <password> --port=6001 --address=localhost --item test -m checkin --patron <borrowernumber> Attempting socket connection to localhost:6001...connected! SEND: 9300CNstaff|COStaff1|CPCPL| READ: 941 Trying 'checkin' SEND: 09N20190521 00310320190521 003103APCPL|AOCPL|ABtest|AC<password>|BIN| READ: 101YNY20190521 003106AOCPL|ABtest|AQCPL|AJTest| After patch: koha@9ec653ab82ce:~/koha$ perl ./misc/sip_cli_emulator.pl -l CPL -su staff -sp <password> --port=6001 --address=localhost --item test -m checkin --patron <borrowernumber> Attempting socket connection to localhost:6001...connected! SEND: 9300CNstaff|CO<password>|CPCPL| READ: 941 Trying 'checkin' SEND: 09N20190521 01000020190521 010000APCPL|AOCPL|ABtest|AC<password>|BIN| READ: 101YNN20190521 010004AOCPL|ABtest|AQCPL|AJTest| Created attachment 89970 [details] [review] Bug 15221: SIP server always sets the alert flag when item not returned The checked in response from the ACS always has the alert bit set to true, even when using the checked_in_ok option. This patch sets the alert bit to 0 when checked_in_ok is used and the item is checked in without a preceding checkout. To test: 0) Create patron in web interface with a cardnumber and userid of "staff" with a password that matches the account in SIPconfig.xml. Also set their branch to CPL (also matching SIPconfig.xml). 1) Create an item with a barcode of 'test' 2) Choose a patron to check out to and record their borrowernumber In one terminal: 3) cd to your git directory (e.g. /home/koha/koha) 4) perl ./C4/SIP/SIPServer.pm ~/koha-dev/etc/SIPconfig.xml In another terminal: 5) cd to your git directory (e.g. /home/koha/koha) 6) perl ./misc/sip_cli_emulator.pl -l CPL -su staff -sp <password> --port=6001 --address=localhost --item test -m checkin --patron <borrowernumber> NOTE: You need to replace <borrowernumber> with the borrowernumber from Step 2, and <password> with the password from Step 0. Before patch: koha@9ec653ab82ce:~/koha$ perl ./misc/sip_cli_emulator.pl -l CPL -su staff -sp <password> --port=6001 --address=localhost --item test -m checkin --patron <borrowernumber> Attempting socket connection to localhost:6001...connected! SEND: 9300CNstaff|COStaff1|CPCPL| READ: 941 Trying 'checkin' SEND: 09N20190521 00310320190521 003103APCPL|AOCPL|ABtest|AC<password>|BIN| READ: 101YNY20190521 003106AOCPL|ABtest|AQCPL|AJTest| After patch: koha@9ec653ab82ce:~/koha$ perl ./misc/sip_cli_emulator.pl -l CPL -su staff -sp <password> --port=6001 --address=localhost --item test -m checkin --patron <borrowernumber> Attempting socket connection to localhost:6001...connected! SEND: 9300CNstaff|CO<password>|CPCPL| READ: 941 Trying 'checkin' SEND: 09N20190521 01000020190521 010000APCPL|AOCPL|ABtest|AC<password>|BIN| READ: 101YNN20190521 010004AOCPL|ABtest|AQCPL|AJTest| Signed-off-by: Liz Rea <wizzyrea@gmail.com> Created attachment 90015 [details] [review] Bug 15221: SIP server always sets the alert flag when item not returned The checked in response from the ACS always has the alert bit set to true, even when using the checked_in_ok option. This patch sets the alert bit to 0 when checked_in_ok is used and the item is checked in without a preceding checkout. To test: 0) Create patron in web interface with a cardnumber and userid of "staff" with a password that matches the account in SIPconfig.xml. Also set their branch to CPL (also matching SIPconfig.xml). 1) Create an item with a barcode of 'test' 2) Choose a patron to check out to and record their borrowernumber In one terminal: 3) cd to your git directory (e.g. /home/koha/koha) 4) perl ./C4/SIP/SIPServer.pm ~/koha-dev/etc/SIPconfig.xml In another terminal: 5) cd to your git directory (e.g. /home/koha/koha) 6) perl ./misc/sip_cli_emulator.pl -l CPL -su staff -sp <password> --port=6001 --address=localhost --item test -m checkin --patron <borrowernumber> NOTE: You need to replace <borrowernumber> with the borrowernumber from Step 2, and <password> with the password from Step 0. Before patch: koha@9ec653ab82ce:~/koha$ perl ./misc/sip_cli_emulator.pl -l CPL -su staff -sp <password> --port=6001 --address=localhost --item test -m checkin --patron <borrowernumber> Attempting socket connection to localhost:6001...connected! SEND: 9300CNstaff|COStaff1|CPCPL| READ: 941 Trying 'checkin' SEND: 09N20190521 00310320190521 003103APCPL|AOCPL|ABtest|AC<password>|BIN| READ: 101YNY20190521 003106AOCPL|ABtest|AQCPL|AJTest| After patch: koha@9ec653ab82ce:~/koha$ perl ./misc/sip_cli_emulator.pl -l CPL -su staff -sp <password> --port=6001 --address=localhost --item test -m checkin --patron <borrowernumber> Attempting socket connection to localhost:6001...connected! SEND: 9300CNstaff|CO<password>|CPCPL| READ: 941 Trying 'checkin' SEND: 09N20190521 01000020190521 010000APCPL|AOCPL|ABtest|AC<password>|BIN| READ: 101YNN20190521 010004AOCPL|ABtest|AQCPL|AJTest| Signed-off-by: Liz Rea <wizzyrea@gmail.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Awesome work all! Pushed to master for 19.05 Tests are failing. t/db_dependent/SIP/Message.t .. 2/4 # Failed test 'Alert flag is set' # at t/db_dependent/SIP/Message.t line 361. # got: 'N' # expected: 'Y' # Failed test 'Checkin without CV triggers alert flag when cv_triggers_alert is off' # at t/db_dependent/SIP/Message.t line 388. # got: 'N' # expected: 'Y' # Looks like you failed 2 tests of 27. t/db_dependent/SIP/Message.t .. 3/4 # Failed test 'Checkin V2' # at t/db_dependent/SIP/Message.t line 74. # Looks like you failed 1 test of 4. Created attachment 90112 [details] [review] Bug 15221: (QA follow-up) Fix Message.t As Jonathan reported on comment11, SIP/Message.t fails now. This is a trivial fix for that. In the first case we should just no longer expect the alert flag. In the second case it makes more sense to toggle the value of the checked_in_ok setting. Test plan: Run t/db_dependent/SIP/Message.t Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> RM: Only last follow-up last follow-up pushed to master for 19.05 Pushed to 18.11.x for 18.11.06 Kyle's found a bug with this patch (https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23057). I'm going to provide a patch on that new report, but I'm under time pressure at the moment, so I'd be happy for someone else to take it over, or just revert this patch as it's probably causing more problems than it's fixing. Declining this for 18.05 as it causes quite a bad bug in SIP for users with Automated Materials Handlers. |