diff --git a/Koha/Object/Limit/Library.pm b/Koha/Object/Limit/Library.pm index cb2f29aa28..85907394e9 100644 --- a/Koha/Object/Limit/Library.pm +++ b/Koha/Object/Limit/Library.pm @@ -19,7 +19,6 @@ use Modern::Perl; use Koha::Database; use Koha::Exceptions; -use Koha::Libraries; use Try::Tiny qw( catch try ); @@ -87,6 +86,8 @@ sub get_library_limits { return unless @branchcodes; + require Koha::Libraries; + my $filter = [ map { { branchcode => $_ } } @branchcodes ]; my $libraries = Koha::Libraries->search( $filter );