Bugzilla – Attachment 182871 Details for
Bug 39145
Differentiate between deleting or transferring public and shared lists
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 39145: Apply new pref values to ->disown_or_delete
Bug-39145-Apply-new-pref-values-to--disownordelete.patch (text/plain), 2.26 KB, created by
David Nind
on 2025-05-31 03:15:47 UTC
(
hide
)
Description:
Bug 39145: Apply new pref values to ->disown_or_delete
Filename:
MIME Type:
Creator:
David Nind
Created:
2025-05-31 03:15:47 UTC
Size:
2.26 KB
patch
obsolete
>From 98a4b4dcf447392e198b9b78dec5ad45444b37ef Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Mon, 17 Feb 2025 10:20:11 +0000 >Subject: [PATCH] Bug 39145: Apply new pref values to ->disown_or_delete > >Test plan: >Set ListOwnershipUponPatronDeletion to 'change owner of >these lists'. >Create a public list1 and a private list2 for patron A. >Enable sharing lists and share list2 with another patron. >Remove patron A. >Check that list1 and list2 are transferred. >Set ListOwnershipUponPatronDeletion to 'change owner of >public lists, delete shared lists'. >Create a public list3 and a private list4 for patron B. >Share list4 with another patron. >Remove patron B. >Check that list3 is transferred and list4 is deleted. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Signed-off-by: David Nind <david@davidnind.com> >--- > Koha/Virtualshelves.pm | 9 ++++++--- > 1 file changed, 6 insertions(+), 3 deletions(-) > >diff --git a/Koha/Virtualshelves.pm b/Koha/Virtualshelves.pm >index 9d60c517b2..e1687b1d73 100644 >--- a/Koha/Virtualshelves.pm >+++ b/Koha/Virtualshelves.pm >@@ -45,9 +45,10 @@ just delete them if not possible. > sub disown_or_delete { > my ($self) = @_; > >+ my $list_pref = C4::Context->preference('ListOwnershipUponPatronDeletion'); > $self->_resultset->result_source->schema->txn_do( > sub { >- if ( C4::Context->preference('ListOwnershipUponPatronDeletion') eq 'transfer' ) { >+ if ( $list_pref ne 'delete' ) { # transfer or transfer_public > my $new_owner; > > $new_owner = C4::Context->preference('ListOwnerDesignated') >@@ -59,9 +60,11 @@ sub disown_or_delete { > } > > while ( my $list = $self->next ) { >- if ( $new_owner && ( $list->is_public or $list->is_shared ) ) { >+ if ( $new_owner && $list->is_public ) { > $list->transfer_ownership($new_owner); >- } else { >+ } elsif ( $new_owner && $list->is_shared && $list_pref eq 'transfer' ) { >+ $list->transfer_ownership($new_owner); >+ } else { # private list, or shared list with transfer_public > $list->delete; > } > } >-- >2.39.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 39145
:
178136
|
178137
|
178138
|
182851
|
182870
| 182871 |
182872
|
182873