SIP checkouts using the "no block" flag will cause the due date to wrongly be used as the transaction date, and the due date will instead be calculated using the circulation rules. In addition, the due date field in the SIP checkout response ( AH ) will be empty.
Created attachment 146450 [details] [review] Bug 32934: Correctly honor the no block due date for SIP checkout messages
Created attachment 146467 [details] [review] Bug 32934: Correctly honor the no block due date for SIP checkout messages
Patch doesn't apply to master/23x. Applied it to 22.11 and seems to be working ok.
Created attachment 162737 [details] [review] Bug 32934: Correctly honor the no block due date for SIP checkout messages
Could you provide a test plan? I'm not that familiar with SIP and need example commands.
(In reply to David Nind from comment #5) > Could you provide a test plan? I'm not that familiar with SIP and need > example commands. Test Plan ( assumes KTD with default data ): 1) Connect to SIP server via Telnet, send the following messages: 9300CNterm1|COterm1|CPCPL| 11YY20240411 14540120270411 145401AOCPL|AA23529001000463|AB39999000001259|ACterm1|BIN| 2) Check Edna's checkouts, not the checkout is not due in 2027 3) Apply this patch, restart the SIP server 4) Check in the item to remove it from Edna's record 5) Repeat step 1 6) The checkout is now due in 2027 as expected!
Is there something you need to do to start the SIP server in KTD? I read these docs: https://wiki.koha-community.org/wiki/Koha_SIP2_server_setup I tried running this command which appears to have done something: kohadev-koha@kohadevbox:koha(master)$ perl C4/S IP/SIPServer.pm /etc/koha/SIPconfig.xml & [1] 25565 But then when I try to connect via telnet it fails: $ telnet localhost 6001 Trying 127.0.0.1... telnet: Unable to connect to remote host: Connection refused I ran the telnet command from a different terminal because ktd doesn't seem to include telnet. I checked SIPconfig.xml and see the config for the user term1, and confirmed that user exists when I run KTD. I think I am missing a step or doing something wrong.
(In reply to Brendan Lawlor from comment #7) > Is there something you need to do to start the SIP server in KTD? > > I read these docs: > https://wiki.koha-community.org/wiki/Koha_SIP2_server_setup > > I tried running this command which appears to have done something: > kohadev-koha@kohadevbox:koha(master)$ perl C4/S > IP/SIPServer.pm /etc/koha/SIPconfig.xml & > [1] 25565 > > But then when I try to connect via telnet it fails: > $ telnet localhost 6001 > Trying 127.0.0.1... > telnet: Unable to connect to remote host: Connection refused > > I ran the telnet command from a different terminal because ktd doesn't seem > to include telnet. > > I checked SIPconfig.xml and see the config for the user term1, and confirmed > that user exists when I run KTD. I think I am missing a step or doing > something wrong. In KTD, you can run the bash alias "restart_all". That should do it for you! KTD does indeed not include telnet but you can install it by running "sudo apt update && sudo apt install -y telnet".
Thanks for the reply Kyle! Unfortunately I still can't connect after running restart_all kohadev-koha@kohadevbox:koha(master)$ telnet localhost 6001 Trying 127.0.0.1... Connection failed: Connection refused Trying ::1... telnet: Unable to connect to remote host: Cannot assign requested address I also tried using this sip emulator but also got denied: kohadev-koha@kohadevbox:koha(master)$ ./misc/sip_cli_emulator.pl -a 127.0.0.1 -p 6001 -su term1 -sp term1 \ -l CPL --patron 23529001000463 -m checkout --item 39999000001259 Attempting socket connection to 127.0.0.1:6001...failed! : Connection refused I am using WSL in case that's relevant.
Test Notes: Add port mapping to ktd docker-compose-lihgt.yml services: koha: ports: - "6001:6001" In ktd --shell install telnet sudo apt update && sudo apt install -y telnet Check that SIP server is running: sudo koha-sip --status kohadev Connect to SIP server and send messages: kohadev-koha@kohadevbox:koha(main)$ telnet localhost 6001 Trying ::1... Connection failed: Connection refused Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. 9300CNterm1|COterm1|CPCPL| 941 11YY20240411 14540120270411 145401AOCPL|AA23529001000463|AB39999000001259|ACterm1|BIN| 121NNY20240419 151631AOCPL|AA23529001000463|AB39999000001259|AJDream of fair to middling women /|AH| ^] 96 Connection closed by foreign host. Check Edna's checkouts, checkout date is 4/11/2027 and due date is 4/16/2027 Check the item in Apply patch. The patch applies without an error, but then there's an issue when you try to restart_all kohadev-koha@kohadevbox:koha(main)$ restart_all Restarting Apache httpd web server: apache2. Restarting Koha ILS: koha-commonStopping Plack daemon for kohadev:. Stopping Z39.50/SRU daemon for kohadev:. Stopping Koha worker daemon for kohadev (default):. Stopping Koha worker daemon for kohadev (long_tasks):. Stopping Koha indexing daemon for kohadev:. Successfully stopped all services for instance koha-common:. Starting Plack daemon for kohadev:. Starting Z39.50/SRU daemon for kohadev:Global symbol "$checkout" requires explicit package name (did you forget to declare "my $checkout"?) at /kohadevbox/koha/C4/Circulation.pm line 4307. Compilation failed in require at /kohadevbox/koha/Koha/Items.pm line 27. BEGIN failed--compilation aborted at /kohadevbox/koha/Koha/Items.pm line 27. Compilation failed in require at /kohadevbox/koha/Koha/Statistic.pm line 25. BEGIN failed--compilation aborted at /kohadevbox/koha/Koha/Statistic.pm line 25. Compilation failed in require at /kohadevbox/koha/Koha/Statistics.pm line 23. BEGIN failed--compilation aborted at /kohadevbox/koha/Koha/Statistics.pm line 23. Compilation failed in require at /kohadevbox/koha/C4/Stats.pm line 22. BEGIN failed--compilation aborted at /kohadevbox/koha/C4/Stats.pm line 22. Compilation failed in require at /kohadevbox/koha/C4/Accounts.pm line 23. BEGIN failed--compilation aborted at /kohadevbox/koha/C4/Accounts.pm line 23. Compilation failed in require at /kohadevbox/koha/C4/Overdues.pm line 30. BEGIN failed--compilation aborted at /kohadevbox/koha/C4/Overdues.pm line 30. Compilation failed in require at /kohadevbox/koha/C4/Members.pm line 27. BEGIN failed--compilation aborted at /kohadevbox/koha/C4/Members.pm line 27. Compilation failed in require at /kohadevbox/koha/C4/Letters.pm line 29. BEGIN failed--compilation aborted at /kohadevbox/koha/C4/Letters.pm line 29. Compilation failed in require at /kohadevbox/koha/Koha/Auth/TwoFactorAuth.pm line 23. BEGIN failed--compilation aborted at /kohadevbox/koha/Koha/Auth/TwoFactorAuth.pm line 23. Compilation failed in require at /kohadevbox/koha/C4/Auth.pm line 40. BEGIN failed--compilation aborted at /kohadevbox/koha/C4/Auth.pm line 40. Compilation failed in require at /kohadevbox/koha/C4/Serials.pm line 37. BEGIN failed--compilation aborted at /kohadevbox/koha/C4/Serials.pm line 37. Compilation failed in require at /kohadevbox/koha/Koha/Biblio.pm line 29. BEGIN failed--compilation aborted at /kohadevbox/koha/Koha/Biblio.pm line 29. Compilation failed in require at /kohadevbox/koha/Koha/Biblios.pm line 25. BEGIN failed--compilation aborted at /kohadevbox/koha/Koha/Biblios.pm line 25. Compilation failed in require at /kohadevbox/koha/Koha/Libraries.pm line 25. BEGIN failed--compilation aborted at /kohadevbox/koha/Koha/Libraries.pm line 25. Compilation failed in require at /kohadevbox/koha/Koha/Object/Limit/Library.pm line 22. BEGIN failed--compilation aborted at /kohadevbox/koha/Koha/Object/Limit/Library.pm line 22. Compilation failed in require at /usr/lib/x86_64-linux-gnu/perl-base/base.pm line 135. ...propagated at /usr/lib/x86_64-linux-gnu/perl-base/base.pm line 157. BEGIN failed--compilation aborted at /kohadevbox/koha/Koha/AuthorisedValue.pm line 25. Compilation failed in require at /kohadevbox/koha/Koha/AuthorisedValues.pm line 25. BEGIN failed--compilation aborted at /kohadevbox/koha/Koha/AuthorisedValues.pm line 25. Compilation failed in require at /kohadevbox/koha/C4/Koha.pm line 27. BEGIN failed--compilation aborted at /kohadevbox/koha/C4/Koha.pm line 27. Compilation failed in require at /kohadevbox/koha/C4/Biblio.pm line 88. BEGIN failed--compilation aborted at /kohadevbox/koha/C4/Biblio.pm line 88. Compilation failed in require at /kohadevbox/koha/Koha/Z3950Responder.pm line 22. BEGIN failed--compilation aborted at /kohadevbox/koha/Koha/Z3950Responder.pm line 22. Compilation failed in require at /kohadevbox/koha/misc/z3950_responder.pl line 27. BEGIN failed--compilation aborted at /kohadevbox/koha/misc/z3950_responder.pl line 27. failed! Starting Koha worker daemon for kohadev (default):. Starting Koha worker daemon for kohadev (long_tasks):. Starting Koha indexing daemon for kohadev:. .
Created attachment 172389 [details] [review] Bug 32934: Correctly honor the no block due date for SIP checkout messages
Created attachment 172399 [details] [review] Bug 32934: Correctly honor the no block due date for SIP checkout messages Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Test notes: Before applying the patch I got: Checked out on 04/11/2027 14:54 Due date 04/16/2027 After applying patch I got: Checked out on 10/04/2024 13:36 Due date 04/11/2027 14:54
Created attachment 172566 [details] [review] Bug 32934: Correctly honor the no block due date for SIP checkout messages Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Created attachment 172567 [details] [review] Bug 32934: (QA follow-up) Tidy code for qa script Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
There is no explanation of the change in the commit message and there are no unit tests. Can you please improve? For me it's not clear right now what the correct behavior is: Should the due date if included in the SIP message only be processed if the block flag is set or always? I had assumed it should only use it when the flag is set. Please add some explanation!