Bug 34156 - C4::Acquisition::FillWithDefaultValues handles leader incorrectly
Summary: C4::Acquisition::FillWithDefaultValues handles leader incorrectly
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Acquisitions (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-06-29 12:47 UTC by Nick Clemens (kidclamp)
Modified: 2023-11-01 09:31 UTC (History)
3 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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