Bug 34156

Summary: C4::Acquisition::FillWithDefaultValues handles leader incorrectly
Product: Koha Reporter: Nick Clemens (kidclamp) <nick>
Component: AcquisitionsAssignee: Bugs List <koha-bugs>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: anneli.osterman, jonathan.druart
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:

Description Nick Clemens (kidclamp) 2023-06-29 12:47:26 UTC
When adding to a basket from a new empty record, we call FillWithDefaultValues on the record from the form.

In MARC::Record the leader is obtained via $record->leader
But FillWithDefaultValues uses the tags form 'GetMarcStructure' where leader is 000
So when you add the record, we don't find a 000 and so add a field

We end up with a record with the original leader, and a controlfield=000 with the default value.
Comment 1 Jonathan Druart 2023-07-05 14:02:09 UTC
How can we fix that? Skip 000?
Comment 2 Nick Clemens (kidclamp) 2023-07-11 17:12:28 UTC
I think we just need to catch field 000 and use the leader subroutine for setting it, need a conditional to catch the case