]> 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)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Thu, 2 Jan 2020 14:53:28 +0000 (14:53 +0000)
commit500400077e471567197d1ad6a551c441d889e9c8
treee9f0655e3127b445fc0607da26bec35278691619
parent31e5359a6cd0dc1b5f02ec1930f418a1344f6478
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>
Koha/Patron/Message.pm