Bug 41649

Summary: Add support for setting the magnetic media flag for SIP in Koha
Product: Koha Reporter: Martin Renvoize (ashimema) <martin.renvoize>
Component: SIP2Assignee: Martin Renvoize (ashimema) <martin.renvoize>
Status: Needs Signoff --- QA Contact: Kyle M Hall (khall) <kyle>
Severity: enhancement    
Priority: P5 - low CC: kyle
Version: unspecified   
Hardware: All   
OS: All   
GIT URL: Initiative type: ---
Sponsorship status: Sponsored Comma delimited list of Sponsors: OpenFifth <https://openfifth.co.uk/>
Crowdfunding goal: 0 Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: Bug 41649: Set magnetic_media in SIP responses
Bug 41649: Add sip_magnetic field to itemtypes table
Bug 41649: DBIC Build
Bug 41649: Add option to set magnetic flag for item itemtypes
Bug 41649: Unit tests for magnetic media
Bug 41649: Set magnetic_media in SIP responses
Bug 41649: Add sip_magnetic field to itemtypes table
Bug 41649: DBIC Build
Bug 41649: Add option to set magnetic flag for item itemtypes
Bug 41649: Unit tests for magnetic media
Bug 41649: Fix SIP Message tests for magnetic media
Bug 41649: DBIC Schema boolean update
Bug 41649: Set magnetic_media in SIP responses
Bug 41649: Add sip_magnetic field to itemtypes table
Bug 41649: DBIC Build
Bug 41649: Add option to set magnetic flag for item itemtypes
Bug 41649: Unit tests for magnetic media
Bug 41649: Fix SIP Message tests for magnetic media
Bug 41649: DBIC Schema boolean update

Description Martin Renvoize (ashimema) 2026-01-16 07:58:49 UTC
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.
Comment 1 Martin Renvoize (ashimema) 2026-01-16 08:17:23 UTC Comment hidden (obsolete)
Comment 2 Martin Renvoize (ashimema) 2026-01-16 08:17:24 UTC Comment hidden (obsolete)
Comment 3 Martin Renvoize (ashimema) 2026-01-16 08:17:26 UTC Comment hidden (obsolete)
Comment 4 Martin Renvoize (ashimema) 2026-01-16 08:17:27 UTC Comment hidden (obsolete)
Comment 5 Martin Renvoize (ashimema) 2026-01-16 08:17:28 UTC Comment hidden (obsolete)
Comment 6 Martin Renvoize (ashimema) 2026-01-20 12:28:07 UTC Comment hidden (obsolete)
Comment 7 Martin Renvoize (ashimema) 2026-01-20 12:28:09 UTC Comment hidden (obsolete)
Comment 8 Martin Renvoize (ashimema) 2026-01-20 12:28:10 UTC Comment hidden (obsolete)
Comment 9 Martin Renvoize (ashimema) 2026-01-20 12:28:11 UTC Comment hidden (obsolete)
Comment 10 Martin Renvoize (ashimema) 2026-01-20 12:28:12 UTC Comment hidden (obsolete)
Comment 11 Martin Renvoize (ashimema) 2026-01-20 12:28:13 UTC Comment hidden (obsolete)
Comment 12 Martin Renvoize (ashimema) 2026-01-20 12:28:15 UTC Comment hidden (obsolete)
Comment 13 Martin Renvoize (ashimema) 2026-01-20 12:48:17 UTC Comment hidden (obsolete)
Comment 14 Martin Renvoize (ashimema) 2026-01-20 12:48:18 UTC Comment hidden (obsolete)
Comment 15 Martin Renvoize (ashimema) 2026-01-20 12:48:19 UTC Comment hidden (obsolete)
Comment 16 Martin Renvoize (ashimema) 2026-01-20 12:48:20 UTC
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)
Comment 17 Martin Renvoize (ashimema) 2026-01-20 12:48:22 UTC Comment hidden (obsolete)
Comment 18 Martin Renvoize (ashimema) 2026-01-20 12:48:23 UTC Comment hidden (obsolete)
Comment 19 Martin Renvoize (ashimema) 2026-01-20 12:48:24 UTC Comment hidden (obsolete)