Summary: | Move populate_empty_callnumbers logic into Koha::Biblio for reusability | ||
---|---|---|---|
Product: | Koha | Reporter: | Tomás Cohen Arazi (tcohen) <tomascohen> |
Component: | Architecture, internals, and plumbing | Assignee: | Tomás Cohen Arazi (tcohen) <tomascohen> |
Status: | Signed Off --- | QA Contact: | Testopia <testopia> |
Severity: | enhancement | ||
Priority: | P5 - low | CC: | tomascohen |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | Small patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Circulation function: | |||
Bug Depends on: | 38226 | ||
Bug Blocks: | |||
Attachments: |
Bug 38224: Unit tests
Bug 38224: Add Koha::Biblio::populate_item_callnumbers Bug 38224: (follow-up) Rewrite endpoint using new core methods Bug 38224: Unit tests Bug 38224: Add Koha::Biblio::populate_item_callnumbers Bug 38224: (follow-up) Rewrite endpoint using new core methods |
Description
Tomás Cohen Arazi (tcohen)
2024-10-22 11:42:23 UTC
Created attachment 173134 [details] [review] Bug 38224: Unit tests Created attachment 173135 [details] [review] Bug 38224: Add Koha::Biblio::populate_item_callnumbers This patch introduces two methods to the `Koha::Biblio` class: * `get_first_callnumber`: returns the first found callnumber on the record, based on the `itemcallnumber` syspref. * `populate_item_callnumbers`: populates the bibliographic record's items based on the return value of `get_first_callnumber`. Can be passed a filter on the items. To test: 1. Apply this patch 2. Run: $ ktd --shell k$ prove t/db_dependent/Koha/Biblio.t => SUCCESS: Tests pass! 3. Sign off :-D Created attachment 173136 [details] [review] Bug 38224: (follow-up) Rewrite endpoint using new core methods Now we have core methods, we can use them to rewrite the controller. Behavior should remain unchanged, so to test: 1. Apply this patches 2. Run: $ ktd --shell k$ prove t/db_dependent/api/v1/rpc/biblios.t => SUCCESS: tests pass! 3. Sign off :-D Created attachment 174244 [details] [review] Bug 38224: Unit tests Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 174245 [details] [review] Bug 38224: Add Koha::Biblio::populate_item_callnumbers This patch introduces two methods to the `Koha::Biblio` class: * `get_first_callnumber`: returns the first found callnumber on the record, based on the `itemcallnumber` syspref. * `populate_item_callnumbers`: populates the bibliographic record's items based on the return value of `get_first_callnumber`. Can be passed a filter on the items. To test: 1. Apply this patch 2. Run: $ ktd --shell k$ prove t/db_dependent/Koha/Biblio.t => SUCCESS: Tests pass! 3. Sign off :-D Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 174246 [details] [review] Bug 38224: (follow-up) Rewrite endpoint using new core methods Now we have core methods, we can use them to rewrite the controller. Behavior should remain unchanged, so to test: 1. Apply this patches 2. Run: $ ktd --shell k$ prove t/db_dependent/api/v1/rpc/biblios.t => SUCCESS: tests pass! 3. Sign off :-D Signed-off-by: Nick Clemens <nick@bywatersolutions.com> |