Bugzilla – Attachment 138543 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.49 KB, created by
Tomás Cohen Arazi (tcohen)
on 2022-08-03 14:45:07 UTC
(
hide
)
Description:
Bug 31288: (QA follow-up) Check userenv in disown_or_delete
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2022-08-03 14:45:07 UTC
Size:
1.49 KB
patch
obsolete
>From b0a77687ac1ece0b767da836b7e9c7d37e10e698 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 > >Test plan: >1. Apply the regression tests >2. Run: > $ kshell > k$ t/db_dependent/Koha/Virtualshelves.t >=> FAIL: Tests fail! >3. Apply this patch >4. Repeat 2 >=> SUCCESS: Tests pass! >5. Sign off :-D > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > 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.37.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