Bug 14468: Remove warnings when creating Labels
authorBernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Sun, 28 Jun 2015 00:41:01 +0000 (21:41 -0300)
committerTomas Cohen Arazi <tomascohen@theke.io>
Tue, 27 Oct 2015 13:12:32 +0000 (10:12 -0300)
commitfea62637df0581d19789bf9a13b4c00ba630856a
tree44b1f1e3a32914a09cb39d59a2107d8d0842183d
parent285cb4dece0e0e0a0fadd83ae14226209bdd8f8d
Bug 14468: Remove warnings when creating Labels

This patch removes 2 types of warnings when
creating Labels

a) Using '0' as filling char is not to the like of prStrWidth
On C4/Creators/Layout.pm

b) A RM followup from Galen on Bug 8375 to C4/Creators/PDF.pm
makes impossible to find properly a font :(
(http://git.koha-community.org/gitweb/?p=koha.git;a=commit;h=f7ef93e758850e991091e7268b8d1b1453082df4)
on C4/Labels/Label.pm

To test:
Pre patch
1) Go to Tools > Labels
2) Create a new layout, name ABC, type 'Barcode/Biblio'
3) Create a new batch, add 2 items
4) Export as PDF using the new layout
5) Look at logs, you will find something like

a) label-create-pdf.pl: Use of uninitialized value $strwidth in numeric lt (<) at /home/bgkriegel/kohaclone/C4/Creators/Layout.pm line 233., referer: http://staffdev.koha-community.org.ar/cgi-bin/koha/labels/label-print.pl
(Only one of this kind)

b) Two related lines similar to this examples
label-create-pdf.pl: Use of uninitialized value in -e at /home/bgkriegel/kohaclone/C4/Creators/PDF.pm line 226., referer: http://staffdev.koha-community.org.ar/cgi-bin/koha/labels/label-print.pl
label-create-pdf.pl: ERROR in koha-conf.xml -- missing <font type="Ft1">/path/to/font.ttf</font> at /home/bgkriegel/kohaclone/C4/Creators/PDF.pm line 229., referer: http://staffdev.koha-community.org.ar/cgi-bin/koha/labels/label-print.pl
(many many lines x number of items on batch)

6) Apply the patch
7) Export the same PDF, no more warnings

8) Bonus 1: change main font to Courier and Helvetica
and check results
9) Bonus 2: check using arabic records

Many hours to find :(
Easy to fix

Signed-off-by: Nick Clemens <nick@quecheelibrary.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
C4/Creators/Layout.pm
C4/Creators/PDF.pm
C4/Labels/Label.pm