]> git.koha-community.org Git - koha.git/commit
Bug 24016: manager_id in Koha::Patron::Message->store should not depend on userenv...
authorLari Taskula <lari.taskula@hypernova.fi>
Tue, 12 Nov 2019 12:18:27 +0000 (12:18 +0000)
committerHayley Mapley <hayleymapley@catalyst.net.nz>
Thu, 20 Feb 2020 02:34:10 +0000 (15:34 +1300)
commit416528064eb4e1e3015c6303b5880d53154e0792
tree764f80a8fcd74176d893806b313b30f31972fb86
parentc3ad074be492b705fe2f16a2d2fb7d34e054f96e
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>
Signed-off-by: Joonas Kylmälä <joonas.kylmala@helsinki.fi>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
(cherry picked from commit 49eac22b1f977b439e5d3f8f313dee3164719b60)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit e13770ad11b4b504413ef020770cd15e8ee55bbc)

Signed-off-by: Hayley Mapley <hayleymapley@catalyst.net.nz>
Koha/Patron/Message.pm