[Koha-bugs] [Bug 24016] manager_id in Koha::Patron::Message->store should not depend on userenv alone

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Tue Dec 17 15:15:00 CET 2019


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24016

Joonas Kylmälä <joonas.kylmala at helsinki.fi> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #95462|0                           |1
        is obsolete|                            |

--- Comment #11 from Joonas Kylmälä <joonas.kylmala at helsinki.fi> ---
Created attachment 96380
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=96380&action=edit
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 at inlibro.com>
Signed-off-by: Joonas Kylmälä <joonas.kylmala at helsinki.fi>

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list