[Bug 42569] New: Refactor Koha::Biblio->get_coins to use MetadataExtractor
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42569 Bug ID: 42569 Summary: Refactor Koha::Biblio->get_coins to use MetadataExtractor Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: koha-bugs@lists.koha-community.org Reporter: tomascohen@gmail.com QA Contact: testopia@bugs.koha-community.org Depends on: 42567 Koha::Biblio->get_coins contains inline MARC parsing that extracts authors, title, ISBN, ISSN, publisher, year, and pages from the record in a flavor-dependent way (MARC21 vs UNIMARC) to build a COinS/OpenURL string. This should be refactored to use the MetadataExtractor pattern: - Add extraction methods for the fields get_coins needs (authors, title, publication info, host record info) - Simplify get_coins to call the extractor and assemble the OpenURL string This is a larger refactoring than the single-field extractions (OCLC, UPC, EAN) since get_coins extracts multiple fields with conditional logic based on leader values. Depends on Bug 42567. Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42567 [Bug 42567] Remove C4::Koha::GetNormalizedEAN in favor of MetadataExtractor -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42569 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |tomascohen@gmail.com |ity.org | Status|NEW |Needs Signoff Patch complexity|--- |Trivial patch -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42569 --- Comment #1 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 198885 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=198885&action=edit Bug 42569: Refactor Koha::Biblio->get_coins to use MetadataExtractor Moves the MARC field extraction logic from get_coins into the MetadataExtractor pattern: - get_coins_data() in base ::MARC class handles leader parsing (genre/material type determination, same for MARC21 and UNIMARC) - _extract_coins_fields() in each flavor subclass extracts authors, title, ISBN, ISSN, publisher, year, pages from flavor-specific fields - get_coins() becomes a thin assembler that builds the OpenURL string from the extractor's output Assisted-by: Sonnet 4.6 (Anthropic) Test plan: 1. Apply patch 2. Run: $ ktd --shell k$ prove t/db_dependent/Koha/Biblio.t \ t/db_dependent/Koha/Biblio/Metadata/Extractor/MARC/MARC21.t \ t/db_dependent/Koha/Biblio/Metadata/Extractor/MARC/UNIMARC.t => SUCCESS: get_coins, get_coins_data tests pass (both flavors) 3. Verify COinS metadata in OPAC detail page source (look for <span class="Z3988">) 4. Sign off :-D -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42569 Jonathan Druart <jonathan.druart@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |jonathan.druart@gmail.com |y.org | CC| |jonathan.druart@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42569 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david@davidnind.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42569 --- Comment #2 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 201883 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=201883&action=edit Bug 42569: Refactor Koha::Biblio->get_coins to use MetadataExtractor Moves the MARC field extraction logic from get_coins into the MetadataExtractor pattern: - get_coins_data() in base ::MARC class handles leader parsing (genre/material type determination, same for MARC21 and UNIMARC) - _extract_coins_fields() in each flavor subclass extracts authors, title, ISBN, ISSN, publisher, year, pages from flavor-specific fields - get_coins() becomes a thin assembler that builds the OpenURL string from the extractor's output Assisted-by: Sonnet 4.6 (Anthropic) Test plan: 1. Apply patch 2. Run: $ ktd --shell k$ prove t/db_dependent/Koha/Biblio.t \ t/db_dependent/Koha/Biblio/Metadata/Extractor/MARC/MARC21.t \ t/db_dependent/Koha/Biblio/Metadata/Extractor/MARC/UNIMARC.t => SUCCESS: get_coins, get_coins_data tests pass (both flavors) 3. Verify COinS metadata in OPAC detail page source (look for <span class="Z3988">) 4. Sign off :-D -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42569 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #198885|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42569 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tomascohen@gmail.com Blocks| |42563 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42563 [Bug 42563] Implement Koha::Biblio->host_items using MetadataExtractor -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org