From 241b78953c14087c975954fc233f0089cb152160 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 20 Feb 2026 11:41:16 +0100 Subject: [PATCH] Bug 41895: Fix if no userenv defined --- C4/Context.pm | 4 +--- Koha/Context/UserEnv.pm | 2 -- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/C4/Context.pm b/C4/Context.pm index 5da92e83f9a..27525a77b6c 100644 --- a/C4/Context.pm +++ b/C4/Context.pm @@ -21,8 +21,6 @@ use Modern::Perl; use vars qw($AUTOLOAD $context); -our $REQUEST_ENV; - BEGIN { if ( $ENV{'HTTP_USER_AGENT'} ) { # Only hit when plack is not enabled @@ -649,7 +647,7 @@ Retrieves a hash for user environment variables. =cut sub userenv { - return Koha::Context::UserEnv->get_all(); + return Koha::Context::UserEnv->get_all() if Koha::Context::UserEnv->exists(); } =head2 set_userenv_from_session diff --git a/Koha/Context/UserEnv.pm b/Koha/Context/UserEnv.pm index 751bcc973df..30dd5679b07 100644 --- a/Koha/Context/UserEnv.pm +++ b/Koha/Context/UserEnv.pm @@ -10,8 +10,6 @@ sub attach { die "userenv must be hashref" unless ref $userenv eq 'HASH'; - die "No request env" unless $REQUEST_ENV; - $REQUEST_ENV->{'koha.userenv'} = $userenv; return $userenv; } -- 2.43.0