View | Details | Raw Unified | Return to bug 41897
Collapse All | Expand All

(-)a/Koha/Objects/Limit/Library.pm (-4 / +3 lines)
Lines 17-23 package Koha::Objects::Limit::Library; Link Here
17
17
18
use Modern::Perl;
18
use Modern::Perl;
19
19
20
use C4::Context;
20
use Koha::Context::UserEnv;
21
use Koha::Database;
21
use Koha::Database;
22
22
23
=head1 NAME
23
=head1 NAME
Lines 54-61 limits Link Here
54
sub search_with_library_limits {
54
sub search_with_library_limits {
55
    my ( $self, $params, $attributes, $library_id ) = @_;
55
    my ( $self, $params, $attributes, $library_id ) = @_;
56
56
57
    $library_id //= C4::Context->userenv->{branch}
57
    $library_id //= Koha::Context::UserEnv->get('branch')
58
        if defined C4::Context->userenv;
58
        if defined Koha::Context::UserEnv->exists;
59
59
60
    return $self->search( $params, $attributes ) unless $library_id;
60
    return $self->search( $params, $attributes ) unless $library_id;
61
61
62
- 

Return to bug 41897