Bug 11351 added the ability to select a media type for SIP responses, however it didn't set the related 'magnetic' bit for SIP. We could hard code that based on media type, but it would be cleaner to allow configuration at the item type level. I'll post two patches here.. the first we've been running in production for around a decade and I thought I'd posted it years ago but can't find it.. the second making it more flexible.
Created attachment 191552 [details] [review] Bug 41649: Set magnetic_media in SIP responses The `magnetic_media` flag was never set, it can be set from `sip_media_type` if it's present. `sip_media_type` is set via the Authorized Values system. Checkins will not be sorted correctly by Biblioteca without this flag.
Created attachment 191553 [details] [review] Bug 41649: Add sip_magnetic field to itemtypes table This patch adds the new sip_magnetic boolean flag field to the itemtypes table to allow flagging the itemtype as magnetic for sip responses.
Created attachment 191554 [details] [review] Bug 41649: DBIC Build Patch from commit 020392b
Created attachment 191555 [details] [review] Bug 41649: Add option to set magnetic flag for item itemtypes This patch adds the ability to set an item type as magentic for SIP response purposes. Test plan: 1) Run included database updates 2) Navigate to admin > itemtypes 3) Edit/Add an itemtype and scroll to the 'Sip media types' input 4) A new 'Sip magnetic' checkbox should be available 5) Confirm setting/unsetting it works as expected 6) The SIP magnetic flag bit should respect the setting
Created attachment 191556 [details] [review] Bug 41649: Unit tests for magnetic media Add unit tests for SIP magnetic media support. Test plan 1) Run t/db_dependent/SIP/Transaction.t in ktd and confirm it passes
Created attachment 191673 [details] [review] Bug 41649: Set magnetic_media in SIP responses The `magnetic_media` flag was never set, it can be set from `sip_media_type` if it's present. `sip_media_type` is set via the Authorized Values system. Checkins will not be sorted correctly by Biblioteca without this flag.
Created attachment 191674 [details] [review] Bug 41649: Add sip_magnetic field to itemtypes table This patch adds the new sip_magnetic boolean flag field to the itemtypes table to allow flagging the itemtype as magnetic for sip responses.
Created attachment 191675 [details] [review] Bug 41649: DBIC Build Patch from commit 0e07ede
Created attachment 191676 [details] [review] Bug 41649: Add option to set magnetic flag for item itemtypes This patch adds the ability to set an item type as magentic for SIP response purposes. Test plan: 1) Run included database updates 2) Navigate to admin > itemtypes 3) Edit/Add an itemtype and scroll to the 'Sip media types' input 4) A new 'Sip magnetic' checkbox should be available 5) Confirm setting/unsetting it works as expected 6) The SIP magnetic flag bit should respect the setting
Created attachment 191677 [details] [review] Bug 41649: Unit tests for magnetic media Add unit tests for SIP magnetic media support. Test plan 1) Run t/db_dependent/SIP/Transaction.t in ktd and confirm it passes
Created attachment 191678 [details] [review] Bug 41649: Fix SIP Message tests for magnetic media The tests for desensitize and alert flags were failing because items were created with random itemtypes that could have sip_magnetic=1. This caused unexpected behavior since magnetic media items don't get desensitized and trigger alert flags. Fix by explicitly creating itemtypes with sip_magnetic=0 in: - test_checkout_desensitize - test_renew_desensitize - test_checkin_v2
Created attachment 191679 [details] [review] Bug 41649: DBIC Schema boolean update Patch from commit 8b7d205
Created attachment 191680 [details] [review] Bug 41649: Set magnetic_media in SIP responses The `magnetic_media` flag was never set, it can be set from `sip_media_type` if it's present. `sip_media_type` is set via the Authorized Values system. Checkins will not be sorted correctly by Biblioteca without this flag.
Created attachment 191681 [details] [review] Bug 41649: Add sip_magnetic field to itemtypes table This patch adds the new sip_magnetic boolean flag field to the itemtypes table to allow flagging the itemtype as magnetic for sip responses.
Created attachment 191682 [details] [review] Bug 41649: DBIC Build Patch from commit 28c2663
Created attachment 191683 [details] [review] Bug 41649: Add option to set magnetic flag for item itemtypes This patch adds the ability to set an item type as magentic for SIP response purposes. Test plan: 1) Run included database updates 2) Navigate to admin > itemtypes 3) Edit/Add an itemtype and scroll to the 'Sip media types' input 4) A new 'Sip magnetic' checkbox should be available 5) Confirm setting/unsetting it works as expected 6) The SIP magnetic flag bit should respect the setting 7) To test SIP functionality: a) Start the SIP server (e.g., koha-sip service) b) Create an item with an itemtype that has sip_magnetic checked c) Use misc/sip_cli_emulator.pl to send a checkout request: perl misc/sip_cli_emulator.pl -a localhost -p 6001 -su <sip_username> -sp <sip_password> -l <location_code> --patron <patron_cardnumber> --password <patron_password> --item <item_barcode> -m checkout d) Check the SIP response to ensure it handles magnetic media correctly (e.g., no desensitization flag)
Created attachment 191684 [details] [review] Bug 41649: Unit tests for magnetic media Add unit tests for SIP magnetic media support. Test plan 1) Run t/db_dependent/SIP/Transaction.t in ktd and confirm it passes
Created attachment 191685 [details] [review] Bug 41649: Fix SIP Message tests for magnetic media The tests for desensitize and alert flags were failing because items were created with random itemtypes that could have sip_magnetic=1. This caused unexpected behavior since magnetic media items don't get desensitized and trigger alert flags. Fix by explicitly creating itemtypes with sip_magnetic=0 in: - test_checkout_desensitize - test_renew_desensitize - test_checkin_v2
Created attachment 191686 [details] [review] Bug 41649: DBIC Schema boolean update Patch from commit f546c71