Bugzilla – Attachment 138526 Details for
Bug 31288
Check userenv in ->disown_or_delete
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 31288: (QA follow-up) Check userenv in disown_or_delete
Bug-31288-QA-follow-up-Check-userenv-in-disownorde.patch (text/plain), 1.52 KB, created by
Marcel de Rooy
on 2022-08-03 11:34:10 UTC
(
hide
)
Description:
Bug 31288: (QA follow-up) Check userenv in disown_or_delete
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2022-08-03 11:34:10 UTC
Size:
1.52 KB
patch
obsolete
>From 768b329cf92b5a1c396aa0b0c8907f18506c743c Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Wed, 3 Aug 2022 11:20:20 +0000 >Subject: [PATCH] Bug 31288: (QA follow-up) Check userenv in disown_or_delete >Content-Type: text/plain; charset=utf-8 > >Test plan: >Run t/db_dependent/Koha/Virtualshelves.t >Set ListOwnershipUponPatronDeletion to change and leave pref >ListOwnerDesignated empty. >Run t/db_dependent/Koha/AdditionalContents.t >* Without this patch, the test would fail in this context. > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > Koha/Virtualshelves.pm | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > >diff --git a/Koha/Virtualshelves.pm b/Koha/Virtualshelves.pm >index d4605883a3..2b82dfc732 100644 >--- a/Koha/Virtualshelves.pm >+++ b/Koha/Virtualshelves.pm >@@ -55,12 +55,12 @@ sub disown_or_delete { > if C4::Context->preference('ListOwnerDesignated') > and Koha::Patrons->find( C4::Context->preference('ListOwnerDesignated') ); > >- unless ($new_owner) { >+ if( !$new_owner && C4::Context->userenv ) { > $new_owner = C4::Context->userenv->{number}; > } > > while ( my $list = $self->next ) { >- if ( $list->is_public or $list->is_shared ) { >+ if ( $new_owner && ( $list->is_public or $list->is_shared ) ) { > $list->transfer_ownership($new_owner); > } else { > $list->delete; >-- >2.20.1
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 31288
:
138525
|
138526
|
138542
|
138543