Bug 40326 - MARC::Record throws fatal errors in many cases for bad leaders
Summary: MARC::Record throws fatal errors in many cases for bad leaders
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Searching - Elasticsearch (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor
Assignee: David Cook
QA Contact: Testopia
URL:
Keywords:
Depends on: 38913
Blocks:
  Show dependency treegraph
 
Reported: 2025-07-08 03:14 UTC by David Cook
Modified: 2025-07-08 04:25 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Cook 2025-07-08 03:14:41 UTC
If you have a bad leader in your MARCXML, trying to generate USMARC from it can itself throw a fatal error:

my $usmarc_record = $record->as_usmarc();

substr outside of string at /usr/share/perl5/MARC/Record.pm line 570.
Something went wrong rebuilding indexes for kohadev
Comment 1 David Cook 2025-07-08 04:25:29 UTC
Renaming from '$record->as_usmarc() throws fatal errors for bad leaders' because there's actually a lot of  places where MARC::Record will throw fatal errors. For example '$record->encoding()'.