Bugzilla – Attachment 95462 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.43 KB, created by
Maryse Simard
on 2019-11-15 19:24:15 UTC
(
hide
)
Description:
Bug 24016: manager_id in Koha::Patron::Message->store should not depend on userenv alone
Filename:
MIME Type:
Creator:
Maryse Simard
Created:
2019-11-15 19:24:15 UTC
Size:
1.43 KB
patch
obsolete
>From b9043f01e2b08e109e8482e1acf1942104b5370a 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 >Signed-off-by: Maryse Simard <maryse.simard@inlibro.com> >--- > 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 ea5b9dc..8383780 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.7.4
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