Bug 41031

Summary: Extractor::MARC->new does not check if metadata is a MARC::Record
Product: Koha Reporter: Marcel de Rooy <m.de.rooy>
Component: Architecture, internals, and plumbingAssignee: Marcel de Rooy <m.de.rooy>
Status: Needs Signoff --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: jonathan.druart, tomascohen
Version: Main   
Hardware: All   
OS: All   
GIT URL: Initiative type: ---
Sponsorship status: --- Crowdfunding goal: 0
Patch complexity: Small patch Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
Circulation function:
Bug Depends on: 40272    
Bug Blocks:    
Attachments: Bug 41031: Add checks on metadata and biblio in Extractor::MARC->new
Bug 41031: Fix the subtest check_fixed_length in MARC21.t

Description Marcel de Rooy 2025-10-16 07:41:50 UTC
See changes in follow-up on bug 40272.
It would not harm to check if the metadata we got, is really a marc record object.
Comment 1 Marcel de Rooy 2025-10-16 09:43:06 UTC
Created attachment 187981 [details] [review]
Bug 41031: Add checks on metadata and biblio in Extractor::MARC->new

Test plan:
Run t/db_dependent/Koha/Biblio/Metadata/Extractor/MARC.t
Verify that addbiblio.pl still opens as expected when modifying an
existing record or adding a new record.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 2 Marcel de Rooy 2025-10-16 09:43:08 UTC
Created attachment 187982 [details] [review]
Bug 41031: Fix the subtest check_fixed_length in MARC21.t

Add test on empty marc object.
Remove MARC21 module and create with parent MARC object.

Test plan:
Run t/db_dependent/Koha/Biblio/Metadata/Extractor/MARC/MARC21.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>