Bug 12916 - Use of uninitialized values $max and $min in C4/Tags.pm
commit32bb90604be79ea97dacc7a02dcbce392ea303fb
authorMark Tompsett <mtompset@hotmail.com>
Thu, 23 Oct 2014 00:51:22 +0000 (22 20:51 -0400)
committerTomas Cohen Arazi <tomascohen@gmail.com>
Thu, 30 Oct 2014 03:31:36 +0000 (30 00:31 -0300)
treec2dd9750ee1f02cc6f3a0226cd36d36e5947f877
parent34d02c375fe7c0793c022662c6b233da4a341a0a
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>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
New and old tests pass. Works as described.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
C4/Tags.pm