Bugzilla – Attachment 183644 Details for
Bug 40277
Warn in C4::Koha::GetAuthorisedValues()
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 40277: Remove warn in C4::Koha::GetAuthorisedValues()
Bug-40277-Remove-warn-in-C4KohaGetAuthorisedValues.patch (text/plain), 1.51 KB, created by
Fridolin Somers
on 2025-06-30 15:18:58 UTC
(
hide
)
Description:
Bug 40277: Remove warn in C4::Koha::GetAuthorisedValues()
Filename:
MIME Type:
Creator:
Fridolin Somers
Created:
2025-06-30 15:18:58 UTC
Size:
1.51 KB
patch
obsolete
>From a9babdf9560c92ca041ec8d87734df30c823ab21 Mon Sep 17 00:00:00 2001 >From: Fridolin Somers <fridolin.somers@biblibre.com> >Date: Mon, 30 Jun 2025 17:04:12 +0200 >Subject: [PATCH] Bug 40277: Remove warn in C4::Koha::GetAuthorisedValues() > >When using not logged in OPAC, we see warns : >Use of uninitialized value $branch_limit in concatenation (.) or string > >It comes from C4::Koha::GetAuthorisedValues() : > my $branch_limit = C4::Context->userenv ? C4::Context->userenv->{"branch"} : ""; > my $cache_key = "AuthorisedValues-$category-$opac-$branch_limit"; > >C4::Context->userenv->{"branch"} can be undef > >Patch fixes wy using C4::Context::mybranch() > >Test plan: >1.1) Without patch >1.2) Go to OPAC without logging in, open some pages >1.3) Check you have the warning in logs >2.1) Apply patch >2.2) Go to OPAC without logging in, open some pages >2.3) Check you don't have the warning in logs >--- > C4/Koha.pm | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/C4/Koha.pm b/C4/Koha.pm >index 13e7a5da7d..bee096db9f 100644 >--- a/C4/Koha.pm >+++ b/C4/Koha.pm >@@ -513,7 +513,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(); > my $result = $cache->get_from_cache($cache_key); >-- >2.43.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 40277
: 183644