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: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2026-01-16 07:58 UTC by Martin Renvoize (ashimema)
Modified: 2026-01-16 08:17 UTC (History)
1 user (show)

See Also:
GIT URL:
Initiative type: ---
Sponsorship status: ---
Comma delimited list of Sponsors:
Crowdfunding goal: 0
Patch complexity: Trivial 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

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
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.
Comment 2 Martin Renvoize (ashimema) 2026-01-16 08:17:24 UTC
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.
Comment 3 Martin Renvoize (ashimema) 2026-01-16 08:17:26 UTC
Created attachment 191554 [details] [review]
Bug 41649: DBIC Build

Patch from commit 020392b
Comment 4 Martin Renvoize (ashimema) 2026-01-16 08:17:27 UTC
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
Comment 5 Martin Renvoize (ashimema) 2026-01-16 08:17:28 UTC
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