Bug 15414: Silencing warns triggered by creating a new layout in patron card creator

This patch assigns $field and $image values in the for loops

To test:
1) Go to Tools -> Patron Card Creator -> New layout
2) Notice warns
3) Apply patch and refresh page
4) Notice warns are gone and page still works as expected

Sponsored-by: Catalyst IT

NOTE: Trivial initialization in a loop issue.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
This commit is contained in:
Aleisha 2016-04-25 23:08:49 +00:00 committed by Kyle M Hall
parent f01bc2bc46
commit d989615c32
1 changed files with 2 additions and 2 deletions

View File

@ -236,7 +236,7 @@ elsif ($op eq 'save') {
elsif ($op eq 'new') { # this is a new layout
$layout = C4::Patroncards::Layout->new();
my @fields = ();
for (my $field; $field < 4; $field++) { # limit 3 text fields
for (my $field = 0; $field < 4; $field++) { # limit 3 text fields
push @fields, (
"field_$field" . "_font" => get_font_types(),
"field_$field" . "_text_alignment" => get_text_justification_types(),
@ -244,7 +244,7 @@ elsif ($op eq 'new') { # this is a new layout
}
my @images = ();
for (my $image; $image < 3; $image++) { #limit 2 images
for (my $image = 0; $image < 3; $image++) { #limit 2 images
push @images, (
"image_$image" . "_image_source" => $image_sources,
"image_$image" . "_image_name" => $image_names,