Summary: | Set maxlength in marc21_framework_DEFAULT.yml | ||
---|---|---|---|
Product: | Koha | Reporter: | David Cook <dcook> |
Component: | Architecture, internals, and plumbing | Assignee: | David Cook <dcook> |
Status: | Signed Off --- | QA Contact: | Testopia <testopia> |
Severity: | minor | ||
Priority: | P5 - low | CC: | david, m.de.rooy |
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 https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=40284 |
||
GIT URL: | Change sponsored?: | --- | |
Patch complexity: | --- | Documentation contact: | |
Documentation submission: | Text to go in the release notes: |
This explicitly sets the "Max length" (maxlength) for MARC21 subfields in the default framework. Most subfields are set by default to 9999, except as follows:
- 000 (Leader - fixed length control field): 24 - existing value
- 008 (Fixed-length data elements--general information - fixed length control field)): 40 - existing value
- 952$2 (Source of classification or shelving scheme): 10
- 952$8 (Collection): 80
- 952$a (Home library): 10
- 952$b (Current library): 10
- 952$c (Shelving location): 80
- 952$f (Coded location qualifier): 10
- 952$i (Inventory number): 80
- 952$o (Full call number): 255
- 952$p (Barcode): 20 - the limit on the barcode field
- 952$t (Copy number): 32
- 952$y (Koha item type): 10
Note: This change only applies for new installations, existing installations will need to manually change their frameworks.
|
|
Version(s) released in: | Circulation function: | ||
Bug Depends on: | 40497 | ||
Bug Blocks: | |||
Attachments: |
Bug 40508: Add maxlength to marc21_framework_DEFAULT.yml
Bug 40508: Add maxlength to marc21_framework_DEFAULT.yml Bug 40508: (follow-up) Update more item field maxlengths Bug 40508: Add maxlength to marc21_framework_DEFAULT.yml Bug 40508: (follow-up) Update more item field maxlengths |
Description
David Cook
2025-07-25 02:49:30 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). 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 Created attachment 184743 [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 Signed-off-by: Owen Leonard <oleonard@myacpl.org> Created attachment 184744 [details] [review] Bug 40508: (follow-up) Update more item field maxlengths - 2 - Source of classification or shelving scheme - 8 - Collection - a - Home library - b - Current library - c - Shelving location - f - Coded location qualifier - i - Inventory number - o - Full call number - t - Copy number - y - Koha item type Created attachment 184763 [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 Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: David Nind <david@davidnind.com> Created attachment 184764 [details] [review] Bug 40508: (follow-up) Update more item field maxlengths - 2 - Source of classification or shelving scheme - 8 - Collection - a - Home library - b - Current library - c - Shelving location - f - Coded location qualifier - i - Inventory number - o - Full call number - t - Copy number - y - Koha item type Signed-off-by: David Nind <david@davidnind.com> Please see also bug 40284. For fields 005, 006 and 007. We are touching the same file. Setting the length to 9999 is definitely wrong. (In reply to Marcel de Rooy from comment #7) > Setting the length to 9999 is definitely wrong. 9999 is the default found in the code, for example: authorities.pl line 104: # determine maximum length; 9999 bytes per ISO 2709 except for leader and MARC21 008 my $max_length = 9999; (In reply to Owen Leonard from comment #8) > (In reply to Marcel de Rooy from comment #7) > > > Setting the length to 9999 is definitely wrong. > > 9999 is the default found in the code, for example: > > authorities.pl line 104: > > # determine maximum length; 9999 bytes per ISO 2709 except for leader and > MARC21 008 > my $max_length = 9999; Changing this one back to "Signed Off", because bug 40284 and bug 40508 are not mutually exclusive. We can add a follow-up here to make the marc21_framework_DEFAULT.yml change from bug 40284 unnecessary, or we can just include them both. It doesn't really matter. If both are pushed, then the right thing will happen in the end. For clarity, a length of 9999 for field 005-007 is definitely wrong. See LOC. (In reply to Marcel de Rooy from comment #10) > For clarity, a length of 9999 for field 005-007 is definitely wrong. See LOC. No one is arguing with you about that. What Owen is saying is that Koha's default for those fields is already 9999. The patch - for the most part - is just reflecting the status quo. Happy for you to add follow-ups like Owen did for the item fields. |