Bugzilla – Attachment 129472 Details for
Bug 29883
Uninitialized value warning when GetAuthorisedValues gets called with no parameters
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29883: avoid uninitialized value warn in GetAuthorisedValues sub
Bug-29883-avoid-uninitialized-value-warn-in-GetAut.patch (text/plain), 1.31 KB, created by
Peter Vashchuk
on 2022-01-14 09:58:19 UTC
(
hide
)
Description:
Bug 29883: avoid uninitialized value warn in GetAuthorisedValues sub
Filename:
MIME Type:
Creator:
Peter Vashchuk
Created:
2022-01-14 09:58:19 UTC
Size:
1.31 KB
patch
obsolete
>From 6c28cc98d08aade57d1c9c6a8351c29d056f4fdc Mon Sep 17 00:00:00 2001 >From: Petro Vashchuk <stalkernoid@gmail.com> >Date: Fri, 14 Jan 2022 11:57:39 +0200 >Subject: [PATCH] Bug 29883: avoid uninitialized value warn in > GetAuthorisedValues sub > >GetAuthorisedValues is defined with optional parameter $category but it >is instantly interpolated without preventing "Use of uninitialized value >$category in concatenation (.) or string at .../C4/Koha.pm line 491." >warning. >As category param is optional, we can avoid throwing that warn as it is >something that can happen and is not an actual error: >C<$category> returns authorized values for just one category (optional). >--- > C4/Koha.pm | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > >diff --git a/C4/Koha.pm b/C4/Koha.pm >index 681d6ff38f..89376b0b4a 100644 >--- a/C4/Koha.pm >+++ b/C4/Koha.pm >@@ -482,10 +482,10 @@ C<$opac> If set to a true value, displays OPAC descriptions rather than normal o > =cut > > sub GetAuthorisedValues { >- my ( $category, $opac ) = @_; >+ my $category = shift // ''; # optional parameter >+ my $opac = shift ? 1 : 0; # normalise to be safe > > # Is this cached already? >- $opac = $opac ? 1 : 0; # normalise to be safe > my $branch_limit = > C4::Context->userenv ? C4::Context->userenv->{"branch"} : ""; > my $cache_key = >-- >2.31.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 29883
:
129472
|
135462
|
135481
|
135482