Bugzilla – Attachment 124942 Details for
Bug 29040
Uninitialized value warning in Languages.pm
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29040: Quiet ninitialized value warnings in Languages.pm
Bug-29040-Quiet-ninitialized-value-warnings-in-Lan.patch (text/plain), 1.77 KB, created by
David Nind
on 2021-09-16 19:43:49 UTC
(
hide
)
Description:
Bug 29040: Quiet ninitialized value warnings in Languages.pm
Filename:
MIME Type:
Creator:
David Nind
Created:
2021-09-16 19:43:49 UTC
Size:
1.77 KB
patch
obsolete
>From 59f0698727f07872c2d25458e34d24662f50877e Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Thu, 16 Sep 2021 12:15:57 +0000 >Subject: [PATCH] Bug 29040: Quiet ninitialized value warnings in Languages.pm > >This patch makes a minor change to getTranslatedLanguages in >Languages.pm in order to quiet a warning shown when the "interface" and >"theme" variables are empty. > >To test, apply the patch go to Administration -> Item types -> Edit >item type. > >- Check the error log: > tail /var/log/koha/kohadev/plack-intranet-error.log >- Before the patch you would see a warning, "Use of uninitialized value > $interface in concatenation (.) or string at > /kohadevbox/koha/C4/Languages.pm line 121." >- After the patch there should be no new warnings. > >Signed-off-by: David Nind <david@davidnind.com> >--- > C4/Languages.pm | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > >diff --git a/C4/Languages.pm b/C4/Languages.pm >index c05c31bf9e..376127d8b2 100644 >--- a/C4/Languages.pm >+++ b/C4/Languages.pm >@@ -112,13 +112,16 @@ Returns a reference to an array of hashes: > sub getTranslatedLanguages { > my ($interface, $theme, $current_language, $which) = @_; > my @languages; >+ my $cache_key = ""; > my @enabled_languages = > ( $interface && $interface eq 'intranet' ) > ? split ",", C4::Context->preference('language') > : split ",", C4::Context->preference('OPACLanguages'); > > my $cache = Koha::Caches->get_instance; >- my $cache_key = "languages_${interface}_${theme}"; >+ if( defined $interface && defined $theme ){ >+ $cache_key = "languages_${interface}_${theme}"; >+ } > if ($interface && $interface eq 'opac' ) { > my $htdocs = C4::Context->config('opachtdocs'); > my $cached = $cache->get_from_cache($cache_key); >-- >2.20.1
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 29040
:
124922
|
124942
|
127866
|
128253
|
128459