Bugzilla – Attachment 95302 Details for
Bug 24016
manager_id in Koha::Patron::Message->store should not depend on userenv alone
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24016: manager_id in Koha::Patron::Message->store should not depend on userenv alone
Bug-24016-managerid-in-KohaPatronMessage-store-sho.patch (text/plain), 1.38 KB, created by
Lari Taskula
on 2019-11-12 12:29:37 UTC
(
hide
)
Description:
Bug 24016: manager_id in Koha::Patron::Message->store should not depend on userenv alone
Filename:
MIME Type:
Creator:
Lari Taskula
Created:
2019-11-12 12:29:37 UTC
Size:
1.38 KB
patch
obsolete
>From 774ceacfe94f81727e315e65661920fcf305cd4f Mon Sep 17 00:00:00 2001 >From: Lari Taskula <lari.taskula@hypernova.fi> >Date: Tue, 12 Nov 2019 12:18:27 +0000 >Subject: [PATCH] Bug 24016: manager_id in Koha::Patron::Message->store should > not depend on userenv alone > >Koha::Patron::Message->store has this > > my $userenv = C4::Context->userenv; > $self->manager_id( $userenv ? $userenv->{number} : undef); > >This breaks in REST API when userenv is not set. > >Let API user pass manager_id without relying on C4::Context->userenv. > >To test: >1. prove t/db_dependent/Koha/Patron/Messages.t >2. Observe success > >Sponsored-by: Koha-Suomi Oy >--- > Koha/Patron/Message.pm | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > >diff --git a/Koha/Patron/Message.pm b/Koha/Patron/Message.pm >index ea5b9dc55b..838378011b 100644 >--- a/Koha/Patron/Message.pm >+++ b/Koha/Patron/Message.pm >@@ -49,8 +49,10 @@ sub store { > and $self->message_type > and $self->branchcode; > >- my $userenv = C4::Context->userenv; >- $self->manager_id( $userenv ? $userenv->{number} : undef); >+ unless (defined $self->manager_id) { >+ my $userenv = C4::Context->userenv; >+ $self->manager_id( $userenv ? $userenv->{number} : undef); >+ } > > C4::Log::logaction( "MEMBERS", "ADDCIRCMESSAGE", $self->borrowernumber, $self->message ) > if C4::Context->preference("BorrowersLog"); >-- >2.17.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 24016
:
95299
|
95300
|
95301
|
95302
|
95461
|
95462
|
96379
|
96380
|
96381
|
96761