Bug 41649 - Add support for setting the magnetic media flag for SIP in Koha
Summary: Add support for setting the magnetic media flag for SIP in Koha
Status: Needs Signoff
Alias: None
Product: Koha
Classification: Unclassified
Component: SIP2 (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low enhancement
Assignee: Martin Renvoize (ashimema)
QA Contact: Kyle M Hall (khall)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2026-01-16 07:58 UTC by Martin Renvoize (ashimema)
Modified: 2026-01-20 12:48 UTC (History)
1 user (show)

See Also:
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 (1.81 KB, patch)
2026-01-16 08:17 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 41649: Add sip_magnetic field to itemtypes table (2.65 KB, patch)
2026-01-16 08:17 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 41649: DBIC Build (1.56 KB, patch)
2026-01-16 08:17 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 41649: Add option to set magnetic flag for item itemtypes (4.06 KB, patch)
2026-01-16 08:17 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 41649: Unit tests for magnetic media (2.68 KB, patch)
2026-01-16 08:17 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 41649: Set magnetic_media in SIP responses (1.81 KB, patch)
2026-01-20 12:28 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 41649: Add sip_magnetic field to itemtypes table (2.76 KB, patch)
2026-01-20 12:28 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 41649: DBIC Build (1.56 KB, patch)
2026-01-20 12:28 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 41649: Add option to set magnetic flag for item itemtypes (4.69 KB, patch)
2026-01-20 12:28 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 41649: Unit tests for magnetic media (2.68 KB, patch)
2026-01-20 12:28 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 41649: Fix SIP Message tests for magnetic media (3.29 KB, patch)
2026-01-20 12:28 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 41649: DBIC Schema boolean update (1.16 KB, patch)
2026-01-20 12:28 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 41649: Set magnetic_media in SIP responses (1.81 KB, patch)
2026-01-20 12:48 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 41649: Add sip_magnetic field to itemtypes table (2.76 KB, patch)
2026-01-20 12:48 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 41649: DBIC Build (1.56 KB, patch)
2026-01-20 12:48 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 41649: Add option to set magnetic flag for item itemtypes (5.20 KB, patch)
2026-01-20 12:48 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 41649: Unit tests for magnetic media (2.68 KB, patch)
2026-01-20 12:48 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 41649: Fix SIP Message tests for magnetic media (3.29 KB, patch)
2026-01-20 12:48 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 41649: DBIC Schema boolean update (1.16 KB, patch)
2026-01-20 12:48 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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)