Bug 37346 - The VirtualShelf object should have an 'owner' accessor to return the related owner Koha::Patron
Summary: The VirtualShelf object should have an 'owner' accessor to return the related...
Status: Needs Signoff
Alias: None
Product: Koha
Classification: Unclassified
Component: Lists (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low enhancement
Assignee: Jake Deery
QA Contact: Martin Renvoize (ashimema)
URL:
Keywords: Academy, roadmap_24_11
Depends on:
Blocks:
 
Reported: 2024-07-12 13:34 UTC by Martin Renvoize (ashimema)
Modified: 2024-10-19 12:45 UTC (History)
2 users (show)

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


Attachments
Bug 37346: Rename 'owner' to 'owner_id' in virtualshelves (48.68 KB, patch)
2024-08-20 11:18 UTC, Jake Deery
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Renvoize (ashimema) 2024-07-12 13:34:37 UTC
We should add an 'owner' accessor to Koha::Virtualshelf that returns the Koha::Patron who owns the List.

The cleanest approach would be to rename the current 'owner' database field to 'owner_id' and then write the usual Koha::Object relation wrapper into Koha::Virtualshelf.

This would improve code consistency and allow for access to the owner directly from the object in notices.
Comment 1 Jake Deery 2024-08-20 11:18:51 UTC
Created attachment 170494 [details] [review]
Bug 37346: Rename 'owner' to 'owner_id' in virtualshelves

This patch will rename the owner field in the virtualshelves database to
owner_id. This makes it more consistent with other tables, and paves the way
for a patch which will allow a direct accessor to the borrower specified in
owner_id.

Test plan:
a)  apply patch
b)  ensure the full test harness works, by running k.t.d with
    RUN_TESTS_AND_EXIT=yes in your .env file
c)  ensure ALL create, read, update, and delete functions work under the
    lists module on the staff client & OPAC (aka TEST EVERYTHING)
d)  ensure you can add to lists from the search on the staff client & OPAC
e)  ensure you can email lists from the send lists button on the staff client &
    OPAC
f)  create a list with at least one biblio inside
g)  enable the ERMModule system preference
    1)  goto the ERM module
    2)  create a package called package
    3)  under titles, select import from list
    4)  select package in the dropdown, and click import next to your list
h)  ensure a biblio is listed under titles in the ERMModule
Comment 2 Jake Deery 2024-08-20 11:20:23 UTC
This patch touches a lot of files. Do we maybe want to split this bug in two for simpler merging into main?