diff --git a/C4/Koha.pm b/C4/Koha.pm index 1c3e2ceb2d..6072c0771d 100644 --- a/C4/Koha.pm +++ b/C4/Koha.pm @@ -488,8 +488,7 @@ sub GetAuthorisedValues { my $opac = shift ? 1 : 0; # normalise to be safe # Is this cached already? - my $branch_limit = - C4::Context->userenv ? C4::Context->userenv->{"branch"} : ""; + my $branch_limit = C4::Context::mybranch(); my $cache_key = "AuthorisedValues-$category-$opac-$branch_limit"; my $cache = Koha::Caches->get_instance();