From 8a302a0f98a7568db387480f49a9dab3ca6126a0 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 20 Feb 2026 11:22:20 +0100 Subject: [PATCH] Bug 41894: Remove error 'Bareword C4::Context::only_my_library not allowed' --- Koha/Libraries.pm | 2 +- Koha/Patron.pm | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Koha/Libraries.pm b/Koha/Libraries.pm index 5594decc9f2..aaaae9daeab 100644 --- a/Koha/Libraries.pm +++ b/Koha/Libraries.pm @@ -54,7 +54,7 @@ sub search_filtered { my @branchcodes = $logged_in_user->libraries_where_can_see_patrons; $params->{branchcode} = { -in => \@branchcodes } if @branchcodes; } else { - if (C4::Context::only_my_library) { + if ( C4::Context->only_my_library ) { $params->{branchcode} = C4::Context->userenv->{branch}; } } diff --git a/Koha/Patron.pm b/Koha/Patron.pm index c0ef6e292c5..f6b2474f20b 100644 --- a/Koha/Patron.pm +++ b/Koha/Patron.pm @@ -2351,7 +2351,7 @@ sub libraries_where_can_see_things { return () unless $userenv; # For tests, but userenv should be defined in tests... my @restricted_branchcodes; - if (C4::Context::only_my_library) { + if ( C4::Context->only_my_library ) { push @restricted_branchcodes, $self->branchcode; } else { unless ( $self->has_permission( { $permission => $subpermission } ) ) { -- 2.43.0