[Bug 43058] New: Remove C4::Items::get_hostitemnumbers_of in favor of Koha::Biblio->host_items
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43058 Bug ID: 43058 Summary: Remove C4::Items::get_hostitemnumbers_of in favor of Koha::Biblio->host_items Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: trivial 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: 42563 Target Milestone: --- C4::Items::get_hostitemnumbers_of duplicates logic now available via Koha::Biblio->host_items (which uses the MetadataExtractor internally, added in Bug 42563). Remaining callers to migrate: - C4/Reserves.pm - C4/ILSDI/Services.pm - reserve/request.pl - t/db_dependent/Items.t Once all callers are migrated, the function can be removed from C4::Items. 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 the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43058 --- Comment #3 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 201887 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=201887&action=edit Bug 43058: Clean up reserve/request.pl host items handling reserve/request.pl imported get_hostitemnumbers_of from C4::Items but never called it -- the code used $biblio->host_items instead. However, it did so with an awkward two-step pattern: my @items = $biblio->items->as_list; my @host_items = $biblio->host_items->as_list; push @items, @host_items if @host_items; Replace with the single idiomatic call: my @items = $biblio->items({ host_items => 1 })->as_list; Test plan: 1. Apply this patch 2. Run: perl -c reserve/request.pl => SUCCESS: Syntax OK 3. Place a hold on an analytic record with EasyAnalyticalRecords on => SUCCESS: Host items are shown on the holds form -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43058 --- Comment #4 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 201888 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=201888&action=edit Bug 43058: Remove C4::Items::get_hostitemnumbers_of All callers have been migrated to use Koha::Biblio->items({ host_items => 1 }) or Koha::Biblio->host_items which delegate to the MetadataExtractor internally. Remove the function from C4::Items and its corresponding test from t/db_dependent/Items.t. The functionality is now covered by tests in: - t/db_dependent/Reserves.t (CanBookBeReserved with host items) - t/db_dependent/ILSDI_Services.t (HoldTitle with analytical records) - t/db_dependent/Koha/Biblio/Metadata/Extractor/MARC/MARC21.t - t/db_dependent/Koha/Biblio/Metadata/Extractor/MARC/UNIMARC.t Test plan: 1. Apply this patch 2. Run: prove t/db_dependent/Items.t => SUCCESS: All 14 tests pass 3. Verify no remaining callers: grep -rn get_hostitemnumbers_of --include='*.pm' --include='*.pl' => No results -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43058 --- Comment #2 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 201886 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=201886&action=edit Bug 43058: Migrate C4::ILSDI::Services from get_hostitemnumbers_of to Koha::Biblio->items HoldTitle() in C4::ILSDI::Services used get_hostitemnumbers_of to manually build a combined item search. Replace it with Koha::Biblio->items({ host_items => 1 }) which already handles the EasyAnalyticalRecords preference and host item lookup. Also removes the now-unused C4::Items import from this module. Test plan: 1. Apply this patch 2. Run: prove t/db_dependent/ILSDI_Services.t => SUCCESS: All tests pass (note: test 17 'no warnings' is a pre-existing failure unrelated to this change) 3. Note the new subtest 'HoldTitle with analytical records (host items)' which verifies: - HoldTitle finds host items for analytic records - Returns NoItems when EasyAnalyticalRecords is off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43058 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Small patch Status|NEW |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43058 --- Comment #1 from Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> --- Created attachment 201885 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=201885&action=edit Bug 43058: Migrate C4::Reserves from get_hostitemnumbers_of to Koha::Biblio->items CanBookBeReserved() used C4::Items::get_hostitemnumbers_of to manually build a combined item search (own items + host items). Replace it with Koha::Biblio->items({ host_items => 1 }) which encapsulates the same logic via the MetadataExtractor. Test plan: 1. Apply this patch 2. Run: prove t/db_dependent/Reserves.t => SUCCESS: All tests pass 3. Note the new subtest 'CanBookBeReserved() with host items (analytical records)' which verifies: - Analytic records can be reserved via host items when EasyAnalyticalRecords is enabled - They cannot when the preference is disabled -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43058 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |martin.renvoize@openfifth.c | |o.uk, tomascohen@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43058 Tomás Cohen Arazi (tcohen) <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |tomascohen@gmail.com |ity.org | -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org