Bug 40272 - Add an alert for incorrect (MARC21) fixed-length control fields
Summary: Add an alert for incorrect (MARC21) fixed-length control fields
Status: Signed Off
Alias: None
Product: Koha
Classification: Unclassified
Component: MARC Bibliographic data support (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Marcel de Rooy
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-06-30 08:58 UTC by Marcel de Rooy
Modified: 2025-07-01 14:42 UTC (History)
0 users

See Also:
GIT URL:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 40272: Add an alert for bad fixed-length control fields (7.18 KB, patch)
2025-06-30 09:30 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 40272: Add an alert for bad fixed-length control fields (7.19 KB, patch)
2025-06-30 12:16 UTC, Owen Leonard
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Marcel de Rooy 2025-06-30 08:58:50 UTC
This proposal adds an alert when opening the MARC basic editor while a control field (005-008) has an incorrect length.

Note that some historical bugs may have caused 008 fields to be shorter than 40 positions.
Comment 1 Marcel de Rooy 2025-06-30 09:30:38 UTC
Created attachment 183640 [details] [review]
Bug 40272: Add an alert for bad fixed-length control fields

Development wise it is much simpler to do this check in perl when
opening the editor than getting this logic into the template with
javascript. Furthermore, older data may be corrupted, but we trust
the current plugins to not insert such fields anymore.

Test plan:
Run t/db_dependent/Koha/Biblio/Metadata/Extractor/MARC/MARC21.t
Open an existing record in the basic editor. Shorten 008 without plugin.
Save and open the record again. Do you get the alert?

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 2 Owen Leonard 2025-06-30 12:16:51 UTC
Created attachment 183641 [details] [review]
Bug 40272: Add an alert for bad fixed-length control fields

Development wise it is much simpler to do this check in perl when
opening the editor than getting this logic into the template with
javascript. Furthermore, older data may be corrupted, but we trust
the current plugins to not insert such fields anymore.

Test plan:
Run t/db_dependent/Koha/Biblio/Metadata/Extractor/MARC/MARC21.t
Open an existing record in the basic editor. Shorten 008 without plugin.
Save and open the record again. Do you get the alert?

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>