Bug 40508

Summary: Set maxlength in marc21_framework_DEFAULT.yml
Product: Koha Reporter: David Cook <dcook>
Component: Architecture, internals, and plumbingAssignee: David Cook <dcook>
Status: Needs Signoff --- QA Contact: Testopia <testopia>
Severity: minor    
Priority: P5 - low    
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40509
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40471
GIT URL: Change sponsored?: ---
Patch complexity: --- Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: Bug 40508: Add maxlength to marc21_framework_DEFAULT.yml

Description David Cook 2025-07-25 02:49:30 UTC
By explicitly setting maxlength in marc21_framework_DEFAULT.yml, we can change the default maxlength for fields in the default framework (and to a degree the ACQ framework).

See Bug 40471
Comment 1 David Cook 2025-07-25 02:50:56 UTC
The following patch uses the default 9999 for all fields except for the 000, 008, and 952$p.

000 and 008 use 24 and 40 respectively (which is set by the "sql_statements" at the bottom of the YAML file anyway.

We set 952$p to 20 as that's the limit on the barcode field (as per bug 40471).
Comment 2 David Cook 2025-07-25 02:55:48 UTC
Created attachment 184610 [details] [review]
Bug 40508: Add maxlength to marc21_framework_DEFAULT.yml

This patch adds maxlength to marc21_framework_DEFAULT.yml.
It uses the default of 9999 for most subfields except 000, 008,
and 952$p. The 000 and 008 use 24 and 40 respectively, although
this is already enforced by the sql_statements at the end of the
file.

The 952$p is set to 20, since the barcode DB field has a length of 20.

Test plan:
0. Apply the patch
1. Take down KTD
2. Bring up KTD
3. Look at the 000, 008, and 952 fields in the default framework
4. Note that 000 uses maxlength 24, 008 uses maxlength 40, 952$p uses
maxlength 20, and every other subfield uses 9999