Bug 37346

Summary: The VirtualShelf object should have an 'owner' accessor to return the related owner Koha::Patron
Product: Koha Reporter: Martin Renvoize (ashimema) <martin.renvoize>
Component: ListsAssignee: Jake Deery <jake.deery>
Status: Patch doesn't apply --- QA Contact: Martin Renvoize (ashimema) <martin.renvoize>
Severity: enhancement    
Priority: P5 - low CC: claire.hernandez, jake.deery, m.de.rooy
Version: unspecifiedKeywords: Academy, roadmap_24_11
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25498
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30955
GIT URL: 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
Bug 37346: Rename 'owner' to 'owner_id' in virtualshelves

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?
Comment 3 Jake Deery 2024-11-13 17:09:46 UTC
Created attachment 174478 [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 4 Jake Deery 2024-11-13 17:10:05 UTC
Found that it needed a rebase :-)

Jake.