Hello everyone, SIP allows you to manage item statuses, but it may be useful to add a list of statuses related to "notforloan" in order to specifically reject some of them.
Created attachment 153756 [details] [review] Bug 34326: Add forbidden notforloan status option Test plan: 1) Add on your sip account an option called "forbidden_notforloan_status" and specify values separated by commas like "1,4,6" related to your notforloan statuses. 2) Restart your SIP server after that 3) Launch your SIP command on checkin with some items with these statuses. See the normal output 4) Apply this patch 5) Do step 3 again and see the new output with forbidden status and lib related to
Hi Thibad, can you explain this a bit more? Is it to prevent checkin of certain items on the self check?
Hi Katrin, Sorry maybe I pushed it a little bit quickly :) It will add a special SIP option, to prevent the checkin of items if they have a special status. For example, if an item has the status "in treasury", we'd like to prevent it from being returned via SIP. So it's based on a customer case but I hope that you understand the way it would work
Hi, I'd like to test this patch but I only have access to sandboxes Do you confirm that, with this condition, I can't test ?
Added the no-sandbox keyword, as you can't normally test SIP2 changes using the sandboxes. Could you please provide some before and after examples for the SIP commands? For those of us not familiar with SIP2 commands, step-by-step instructions to walk through the commands are essential. More for QA, but I think your patch needs a description, as per the commit message guidelines https://wiki.koha-community.org/wiki/Commit_messages
(In reply to David Nind from comment #5) > Added the no-sandbox keyword, as you can't normally test SIP2 changes using > the sandboxes. ok, thanks !
Created attachment 180741 [details] [review] Bug 34326: (follow-up) Add forbidden notforloan status option Add a SIP option to prevent the checkin of items if they have a special status. The follow-up fixes a bug where SIP reported a failed checkin even if the checkin was correctly done by Koha. Test plan (assuming ktd) 1- checkout 4 items to a single patron In the following example I used barcode 3999900000017, 3999900000018, 3999900000019 and 3999900000020 and the patron cardnumber 23529000035676 2- Update these items notforloan value ($7 in marc21, $o in unimarc) with 3 different not for loan status and an empty not for loan status In the following example I used 3999900000017 notforloan = 1 "Not for loan" 3999900000018 notforloan = 2 "Staff collection" 3999900000019 notforloan = 3 "Added to bundle" 3999900000020 notforloan is empty 3- Edit file /etc/koha/sites/kohadev/SIPconfig.xml Add to one of the login the parameter "forbidden_notforloan_status"" with two different notforloan status previously used In the following example I used <login id="term1" password="term1" delimiter="|" error-detect="enabled" institution="CPL" encoding="ascii" checked_in_ok="1" forbidden_notforloan_status="1,2" /> 4- restart sip (in KTD "sudo koha-sip --stop kohadev" then "sudo koha-sip --start kohadev") 5- checkin the first two items with sip_cli_emulator (the ones with the forbidden notforloan status). The checkin should fail (response starts with 100), a screen message (AF field) is added to explain and these items should still be checked out to the patron in the interface /kohadevbox/koha/misc/sip_cli_emulator.pl -a 127.0.0.1 -p 6001 -su=term1 -sp=term1 -l=CPL -m=checkin --patron=23529000035676 --item=3999900000017 /kohadevbox/koha/misc/sip_cli_emulator.pl -a 127.0.0.1 -p 6001 -su=term1 -sp=term1 -l=CPL -m=checkin --patron=23529000035676 --item=3999900000018 6- checkin the last two items with sip_cli_emulator (the one with the allowed notforloan status and the one without any notforloan status). The checkin should succeed (response starts with 101) and these items should not appear in the checked out items to the patron in the interface. /kohadevbox/koha/misc/sip_cli_emulator.pl -a 127.0.0.1 -p 6001 -su=term1 -sp=term1 -l=CPL -m=checkin --patron=23529000035676 --item=3999900000019 /kohadevbox/koha/misc/sip_cli_emulator.pl -a 127.0.0.1 -p 6001 -su=term1 -sp=term1 -l=CPL -m=checkin --patron=23529000035676 --item=3999900000020
Hi, (I assumed step 0 was 'Apply patch, update the database, retart service') here is what 'git bz apply 34326'gives : Applying: Bug 34326: Add forbidden notforloan status option Using index info to reconstruct a base tree... M C4/SIP/ILS.pm M C4/SIP/ILS/Transaction/Checkin.pm Falling back to patching base and 3-way merge... Auto-merging C4/SIP/ILS/Transaction/Checkin.pm CONFLICT (content): Merge conflict in C4/SIP/ILS/Transaction/Checkin.pm Auto-merging C4/SIP/ILS.pm CONFLICT (content): Merge conflict in C4/SIP/ILS.pm error: Failed to merge in the changes. Patch failed at 0001 Bug 34326: Add forbidden notforloan status option
Hi Thank you for testing. You assume correctly I miss a step 0, I will update the test plan to add this step. I will also fix the rebase conflict.
Created attachment 180750 [details] [review] Bug 34326: Add forbidden notforloan status option Test plan: 1) Add on your sip account an option called "forbidden_notforloan_status" and specify values separated by commas like "1,4,6" related to your notforloan statuses. 2) Restart your SIP server after that 3) Launch your SIP command on checkin with some items with these statuses. See the normal output 4) Apply this patch 5) Do step 3 again and see the new output with forbidden status and lib related to
Created attachment 180751 [details] [review] Bug 34326: (follow-up) Add forbidden notforloan status option Add a SIP option to prevent the checkin of items if they have a special status. The follow-up fixes a bug where SIP reported a failed checkin even if the checkin was correctly done by Koha. Test plan (assuming ktd) 0- Apply the patch, restart services (restart_all with KTD) (no need to update database) 1- checkout 4 items to a single patron In the following example I used barcode 3999900000017, 3999900000018, 3999900000019 and 3999900000020 and the patron cardnumber 23529000035676 2- Update these items notforloan value ($7 in marc21, $o in unimarc) with 3 different not for loan status and an empty not for loan status In the following example I used 3999900000017 notforloan = 1 "Not for loan" 3999900000018 notforloan = 2 "Staff collection" 3999900000019 notforloan = 3 "Added to bundle" 3999900000020 notforloan is empty 3- Edit file /etc/koha/sites/kohadev/SIPconfig.xml Add to one of the login the parameter "forbidden_notforloan_status"" with two different notforloan status previously used In the following example I used <login id="term1" password="term1" delimiter="|" error-detect="enabled" institution="CPL" encoding="ascii" checked_in_ok="1" forbidden_notforloan_status="1,2" /> 4- restart sip (in KTD "sudo koha-sip --stop kohadev" then "sudo koha-sip --start kohadev") 5- checkin the first two items with sip_cli_emulator (the ones with the forbidden notforloan status). The checkin should fail (response starts with 100), a screen message (AF field) is added to explain and these items should still be checked out to the patron in the interface /kohadevbox/koha/misc/sip_cli_emulator.pl -a 127.0.0.1 -p 6001 -su=term1 -sp=term1 -l=CPL -m=checkin --patron=23529000035676 --item=3999900000017 /kohadevbox/koha/misc/sip_cli_emulator.pl -a 127.0.0.1 -p 6001 -su=term1 -sp=term1 -l=CPL -m=checkin --patron=23529000035676 --item=3999900000018 6- checkin the last two items with sip_cli_emulator (the one with the allowed notforloan status and the one without any notforloan status). The checkin should succeed (response starts with 101) and these items should not appear in the checked out items to the patron in the interface. /kohadevbox/koha/misc/sip_cli_emulator.pl -a 127.0.0.1 -p 6001 -su=term1 -sp=term1 -l=CPL -m=checkin --patron=23529000035676 --item=3999900000019 /kohadevbox/koha/misc/sip_cli_emulator.pl -a 127.0.0.1 -p 6001 -su=term1 -sp=term1 -l=CPL -m=checkin --patron=23529000035676 --item=3999900000020
Rebased for master
Hi, Many thanks for this test plan : it's really very clear, with many details! As I discover ktd, it took time for me to find the good file to modify and the way to do it with vim here is a copy of the line I changed : 46 <accounts> 47 <login id="term1" password="term1" delimiter="|" error-detect="enabled" institution="CPL" encoding="ascii" checked_in_ok="1" forbidden_notfotloan_status="1,2" /> Unfortunately, this patch doesn't apply (but I may have missed something) : all checkins occurred Here are the first and third checkins (you'll recognize the barcodes : I followed your examples) kohadev-koha@kohadevbox:/$ /kohadevbox/koha/misc/sip_cli_emulator.pl -a 127.0.0.1 -p 6001 -su=term1 -sp=term1 -l=CPL -m=checkin --patron=23529000035676 --item=3999900000017 Attempting socket connection to 127.0.0.1:6001...connected! Use of uninitialized value $hold_mode in string eq at /kohadevbox/koha/misc/sip_cli_emulator.pl line 127. SEND: 9300CNterm1|COterm1|CPCPL| READ: 941 Trying 'checkin' SEND: 09N20250410 19515120250410 195151APCPL|AOCPL|AB3999900000017|ACterm1|BIN| READ: 101YNN20250410 195151AOCPL|AB3999900000017|AQCPL|AJCrimes parfaits|AA23529000035676|CSCN_3784| ------------------- kohadev-koha@kohadevbox:/$ /kohadevbox/koha/misc/sip_cli_emulator.pl -a 127.0.0.1 -p 6001 -su=term1 -sp=term1 -l=CPL -m=checkin --patron=23529000035676 --item=3999900000019 Attempting socket connection to 127.0.0.1:6001...connected! Use of uninitialized value $hold_mode in string eq at /kohadevbox/koha/misc/sip_cli_emulator.pl line 127. SEND: 9300CNterm1|COterm1|CPCPL| READ: 941 Trying 'checkin' SEND: 09N20250410 19562120250410 195621APCPL|AOCPL|AB3999900000019|ACterm1|BIN| READ: 101YNN20250410 195622AOCPL|AB3999900000019|AQCPL|AJDerni?res nouvelles de la nuit|AA23529000035676|CSCN_1129| Please, forgive me if this comment is too long or doesn't follow the protocol
Created attachment 180819 [details] [review] Bug 34326: Add forbidden notforloan status option Test plan: 1) Add on your sip account an option called "forbidden_notforloan_status" and specify values separated by commas like "1,4,6" related to your notforloan statuses. 2) Restart your SIP server after that 3) Launch your SIP command on checkin with some items with these statuses. See the normal output 4) Apply this patch 5) Do step 3 again and see the new output with forbidden status and lib related to Signed-off-by: Emmanuel Bétemps <e.betemps@gmail.com>
Created attachment 180820 [details] [review] Bug 34326: (follow-up) Add forbidden notforloan status option Add a SIP option to prevent the checkin of items if they have a special status. The follow-up fixes a bug where SIP reported a failed checkin even if the checkin was correctly done by Koha. Test plan (assuming ktd) 0- Apply the patch, restart services (restart_all with KTD) (no need to update database) 1- checkout 4 items to a single patron In the following example I used barcode 3999900000017, 3999900000018, 3999900000019 and 3999900000020 and the patron cardnumber 23529000035676 2- Update these items notforloan value ($7 in marc21, $o in unimarc) with 3 different not for loan status and an empty not for loan status In the following example I used 3999900000017 notforloan = 1 "Not for loan" 3999900000018 notforloan = 2 "Staff collection" 3999900000019 notforloan = 3 "Added to bundle" 3999900000020 notforloan is empty 3- Edit file /etc/koha/sites/kohadev/SIPconfig.xml Add to one of the login the parameter "forbidden_notforloan_status"" with two different notforloan status previously used In the following example I used <login id="term1" password="term1" delimiter="|" error-detect="enabled" institution="CPL" encoding="ascii" checked_in_ok="1" forbidden_notforloan_status="1,2" /> 4- restart sip (in KTD "sudo koha-sip --stop kohadev" then "sudo koha-sip --start kohadev") 5- checkin the first two items with sip_cli_emulator (the ones with the forbidden notforloan status). The checkin should fail (response starts with 100), a screen message (AF field) is added to explain and these items should still be checked out to the patron in the interface /kohadevbox/koha/misc/sip_cli_emulator.pl -a 127.0.0.1 -p 6001 -su=term1 -sp=term1 -l=CPL -m=checkin --patron=23529000035676 --item=3999900000017 /kohadevbox/koha/misc/sip_cli_emulator.pl -a 127.0.0.1 -p 6001 -su=term1 -sp=term1 -l=CPL -m=checkin --patron=23529000035676 --item=3999900000018 6- checkin the last two items with sip_cli_emulator (the one with the allowed notforloan status and the one without any notforloan status). The checkin should succeed (response starts with 101) and these items should not appear in the checked out items to the patron in the interface. /kohadevbox/koha/misc/sip_cli_emulator.pl -a 127.0.0.1 -p 6001 -su=term1 -sp=term1 -l=CPL -m=checkin --patron=23529000035676 --item=3999900000019 /kohadevbox/koha/misc/sip_cli_emulator.pl -a 127.0.0.1 -p 6001 -su=term1 -sp=term1 -l=CPL -m=checkin --patron=23529000035676 --item=3999900000020 Signed-off-by: Emmanuel Bétemps <e.betemps@gmail.com>
Hi, - I changed the term1's password (in both staff interface and SIPconfig.xml) in Koha1234 - when I ran sip_cli_emulator.pl, I changed the '-sp' to get '-sp=Koha1234' -> checkins which had to fail, failed -> checkins which had to succeed, succeeded (thanks again for this patch and test plan which taught me many things)
Created attachment 181003 [details] [review] Bug 34326: Add forbidden notforloan status option Test plan: 1) Add on your sip account an option called "forbidden_notforloan_status" and specify values separated by commas like "1,4,6" related to your notforloan statuses. 2) Restart your SIP server after that 3) Launch your SIP command on checkin with some items with these statuses. See the normal output 4) Apply this patch 5) Do step 3 again and see the new output with forbidden status and lib related to Signed-off-by: Emmanuel Bétemps <e.betemps@gmail.com> Sponsored-by: Médiathèque B. Pivot - Caluire-et-Cuire
Created attachment 181004 [details] [review] Bug 34326: (follow-up) Add forbidden notforloan status option Add a SIP option to prevent the checkin of items if they have a special status. The follow-up fixes a bug where SIP reported a failed checkin even if the checkin was correctly done by Koha. Test plan (assuming ktd) 0- Apply the patch, restart services (restart_all with KTD) (no need to update database) 1- checkout 4 items to a single patron In the following example I used barcode 3999900000017, 3999900000018, 3999900000019 and 3999900000020 and the patron cardnumber 23529000035676 2- Update these items notforloan value ($7 in marc21, $o in unimarc) with 3 different not for loan status and an empty not for loan status In the following example I used 3999900000017 notforloan = 1 "Not for loan" 3999900000018 notforloan = 2 "Staff collection" 3999900000019 notforloan = 3 "Added to bundle" 3999900000020 notforloan is empty 3- Edit file /etc/koha/sites/kohadev/SIPconfig.xml Add to one of the login the parameter "forbidden_notforloan_status"" with two different notforloan status previously used In the following example I used <login id="term1" password="term1" delimiter="|" error-detect="enabled" institution="CPL" encoding="ascii" checked_in_ok="1" forbidden_notforloan_status="1,2" /> 4- restart sip (in KTD "sudo koha-sip --stop kohadev" then "sudo koha-sip --start kohadev") 5- checkin the first two items with sip_cli_emulator (the ones with the forbidden notforloan status). The checkin should fail (response starts with 100), a screen message (AF field) is added to explain and these items should still be checked out to the patron in the interface /kohadevbox/koha/misc/sip_cli_emulator.pl -a 127.0.0.1 -p 6001 -su=term1 -sp=term1 -l=CPL -m=checkin --patron=23529000035676 --item=3999900000017 /kohadevbox/koha/misc/sip_cli_emulator.pl -a 127.0.0.1 -p 6001 -su=term1 -sp=term1 -l=CPL -m=checkin --patron=23529000035676 --item=3999900000018 6- checkin the last two items with sip_cli_emulator (the one with the allowed notforloan status and the one without any notforloan status). The checkin should succeed (response starts with 101) and these items should not appear in the checked out items to the patron in the interface. /kohadevbox/koha/misc/sip_cli_emulator.pl -a 127.0.0.1 -p 6001 -su=term1 -sp=term1 -l=CPL -m=checkin --patron=23529000035676 --item=3999900000019 /kohadevbox/koha/misc/sip_cli_emulator.pl -a 127.0.0.1 -p 6001 -su=term1 -sp=term1 -l=CPL -m=checkin --patron=23529000035676 --item=3999900000020 Signed-off-by: Emmanuel Bétemps <e.betemps@gmail.com> Sponsored-by: Médiathèque B. Pivot - Caluire-et-Cuire