Bugzilla – Attachment 32701 Details for
Bug 12916
Use of uninitialized values $max and $min in C4/Tags.pm
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 12916 - Use of uninitialized values $max and $min in C4/Tags.pm
Bug-12916---Use-of-uninitialized-values-max-and-mi.patch (text/plain), 1.43 KB, created by
Chris Cormack
on 2014-10-25 03:23:35 UTC
(
hide
)
Description:
Bug 12916 - Use of uninitialized values $max and $min in C4/Tags.pm
Filename:
MIME Type:
Creator:
Chris Cormack
Created:
2014-10-25 03:23:35 UTC
Size:
1.43 KB
patch
obsolete
>From f0da3a47d51d2663ef691e28b88f86171376303e Mon Sep 17 00:00:00 2001 >From: Mark Tompsett <mtompset@hotmail.com> >Date: Wed, 22 Oct 2014 20:51:22 -0400 >Subject: [PATCH] Bug 12916 - Use of uninitialized values $max and $min in > C4/Tags.pm > >When the stratify_tags function is called without any tags, the >$min and $max variables are left undefined, which triggers a >warning message about uninitialized values in the subtraction. > >TEST PLAN >--------- >1) prove -v t/db_dependent/Tags.t > -- should succeed, but there is no test for empty tags. >2) Make sure that you have no tags >3) In Opac, go to 'Tag cloud' >4) Check the opac error log file > (e.g. ~/koha-dev/var/log/koha-opac-error_log) for entries > regarding uninitialized values $max and $min in C4/Tags.pm >5) apply this patch >6) prove -v t/db_dependent/Tags.t > -- should still succeed, though no tests are added. >7) Reload page 'Tag cloud' > -- Result: No additional warnings in opac error log file. > >Signed-off-by: Chris <chris@bigballofwax.co.nz> >--- > C4/Tags.pm | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/C4/Tags.pm b/C4/Tags.pm >index b6b319b..c775da9 100644 >--- a/C4/Tags.pm >+++ b/C4/Tags.pm >@@ -588,7 +588,7 @@ sub add_tag { # biblionumber,term,[borrowernumber,approvernumber] > # value. > sub stratify_tags { > my ( $strata, $tags ) = @_; >- >+ return (0,0) if !@$tags; > my ( $min, $max ); > foreach (@$tags) { > my $w = $_->{weight_total}; >-- >1.7.10.4
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 12916
:
31792
|
32590
|
32604
|
32605
|
32611
|
32612
|
32700
|
32701
|
32732
|
32733