Bug 40711 - Fix value builder for 181 in UNIMARC
Summary: Fix value builder for 181 in UNIMARC
Status: Signed Off
Alias: None
Product: Koha
Classification: Unclassified
Component: Cataloging (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Baptiste Wojtkowski (bwoj)
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-08-27 09:58 UTC by Baptiste Wojtkowski (bwoj)
Modified: 2025-12-27 01:53 UTC (History)
2 users (show)

See Also:
GIT URL:
Initiative type: ---
Sponsorship status: ---
Comma delimited list of Sponsors:
Crowdfunding goal: 0
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Fixes the value builder for UNIMARC 181$c and 181$2: - 181$c: now inserts the correct codes from the dropdown list (previously, it would populate the field with incorrect values - choosing cri would not add a value, crm would insert an a as the value) - 181$2: now uses the correct HTML body ID (previously it was cat_unimarc_field_182-2, now it is cat_unimarc_field_181-2)
Version(s) released in:
Circulation function:


Attachments
Bug 40711: Fix valuebuilder for UNIMARC 181c (3.07 KB, patch)
2025-08-27 12:02 UTC, Baptiste Wojtkowski (bwoj)
Details | Diff | Splinter Review
Bug 40711: Fix valuebuilder for UNIMARC 181c and 2 (3.07 KB, patch)
2025-08-27 12:05 UTC, Baptiste Wojtkowski (bwoj)
Details | Diff | Splinter Review
Bug 40711: Fix valuebuilder for UNIMARC 181c and 2 (3.12 KB, patch)
2025-12-27 01:33 UTC, David Nind
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Baptiste Wojtkowski (bwoj) 2025-08-27 09:58:28 UTC
There are some little issues with valuebuilder that need a fix
Comment 1 Baptiste Wojtkowski (bwoj) 2025-08-27 12:02:57 UTC
Created attachment 185812 [details] [review]
Bug 40711: Fix valuebuilder for UNIMARC 181c

Test plan (UNIMARC ONLY):
1 - Make sure you have valuebuilder enabled for 181$c and 181$2 (see hereafter)
2 - Edit any record. Use valuebuilder to set 181$c to "cri - cartographic image", notice there is no change
3 - Use valuebuilder to set 181$c to "crm - cartographic moving image", notice it is set to "a"
4 - Open the valuebuilder for 181$2 and inspect the body ID. See it is cat_unimarc_field_182-2.
5 - Apply patch
6 - Repeat 2&3 and notice the codes are now cri respectively cri and crm
7 - Open the valuebuilder for 181$2 and inspect the body ID. See it is cat_unimarc_field_181-2.
Comment 2 Baptiste Wojtkowski (bwoj) 2025-08-27 12:05:55 UTC
Created attachment 185813 [details] [review]
Bug 40711: Fix valuebuilder for UNIMARC 181c and 2

Test plan (UNIMARC ONLY):
1 - Make sure you have valuebuilder enabled for 181$c and 181$2 (see hereafter)
2 - Edit any record. Use valuebuilder to set 181$c to "cri - cartographic image", notice there is no change
3 - Use valuebuilder to set 181$c to "crm - cartographic moving image", notice it is set to "a"
4 - Open the valuebuilder for 181$2 and inspect the body ID. See it is cat_unimarc_field_182-2.
5 - Apply patch
6 - Repeat 2&3 and notice the codes are now cri respectively cri and crm
7 - Open the valuebuilder for 181$2 and inspect the body ID. See it is cat_unimarc_field_181-2.
Comment 3 David Nind 2025-12-27 01:33:25 UTC
Created attachment 190744 [details] [review]
Bug 40711: Fix valuebuilder for UNIMARC 181c and 2

Test plan (UNIMARC ONLY):
1 - Make sure you have valuebuilder enabled for 181$c and 181$2 (see hereafter)
2 - Edit any record. Use valuebuilder to set 181$c to "cri - cartographic image", notice there is no change
3 - Use valuebuilder to set 181$c to "crm - cartographic moving image", notice it is set to "a"
4 - Open the valuebuilder for 181$2 and inspect the body ID. See it is cat_unimarc_field_182-2.
5 - Apply patch
6 - Repeat 2&3 and notice the codes are now cri respectively cri and crm
7 - Open the valuebuilder for 181$2 and inspect the body ID. See it is cat_unimarc_field_181-2.

Signed-off-by: David Nind <david@davidnind.com>
Comment 4 David Nind 2025-12-27 01:53:13 UTC
Testing notes (using KTD):

0. Start up a UNIMARC instance: KOHA_MARC_FLAVOR=unimarc ktd up

1. To make sure the value builder is triggered when editing a record:
   1.1 Go to Koha administration > Catalog > MARC bibliographic frameworks > Default framework > Actions > MARC structure
   1.2 Search for tag 181
   1.3 Actions > Edit subfields
   1.4 For 181$2, add unimarc_field_181-2.pl as the plugin
   1.5 For 181$c:
       - remove unimarc_181c from authorized value
       - add unimarc_field_181c.pl as the plugin

2. I added the assignee, changed the importance from 'enhancement' to 'normal', as it fixes something not working correctly.

3. Added a draft release note.