Bug 37305

Summary: Remove C4::Biblio::prepare_marc_host and use Koha::Biblio->generate_marc_host_field in preference
Product: Koha Reporter: Martin Renvoize (ashimema) <martin.renvoize>
Component: Architecture, internals, and plumbingAssignee: Martin Renvoize (ashimema) <martin.renvoize>
Status: Needs Signoff --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: flyingendpaper
Version: unspecified   
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:
Bug Depends on: 37364    
Bug Blocks: 22439    
Attachments: Bug 37305: Subfield order matters
Bug 37305: Remove C4::Biblio::prepare_host_field

Description Martin Renvoize (ashimema) 2024-07-10 13:10:19 UTC
We introduce the new method and add unit tests for it in bug 29560. We should now be able to remove the untested and non-object-oriented method from C4::Biblio.

It would also be nice to start working toward merging UseControlNumber and EasyAnalytics and thus also remove the very similar C4::Biblio::PrepareMarcHost() method.
Comment 1 Martin Renvoize (ashimema) 2024-07-17 10:07:33 UTC
Created attachment 169078 [details] [review]
Bug 37305: Subfield order matters

This patch updates the use of a hash to store and then pass subfields to
the MARC::Field new method to an array with key/value pairs using fat comma's.

This allows us to maintain the integrity check that we're passing string
as the first arguament in each pair whilst also allowing us to ensure
fields are passed in the order they are found.
Comment 2 Martin Renvoize (ashimema) 2024-07-17 10:07:36 UTC
Created attachment 169079 [details] [review]
Bug 37305: Remove C4::Biblio::prepare_host_field

This patch updates the only use of prepare_host_field to use the well
tested Koha::Biblio->generate_marc_host_field method instead and then
removes the aforementioned prepare_host_field method from C4::Biblio.

Test plan
1) Ensure the "enhanced workflow" for creating analytics still functions
   as expected.