Bug 15414 - Noisy warns when creating new layout for patron card creator
Summary: Noisy warns when creating new layout for patron card creator
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Tools (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Aleisha Amohia
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-12-22 23:32 UTC by Aleisha Amohia
Modified: 2016-12-05 21:27 UTC (History)
1 user (show)

See Also:
Change sponsored?: Sponsored
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 15414: Silencing warns triggered by creating a new layout in patron card creator (1.65 KB, patch)
2016-04-25 23:10 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 15414: Silencing warns triggered by creating a new layout in patron card creator (1.74 KB, patch)
2016-04-25 23:43 UTC, Mark Tompsett
Details | Diff | Splinter Review
Bug 15414: Silencing warns triggered by creating a new layout in patron card creator (1.79 KB, patch)
2016-04-28 13:44 UTC, Kyle M Hall
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Aleisha Amohia 2015-12-22 23:32:03 UTC
edit-layout.pl: Use of uninitialized value $field in numeric lt (<) at /home/vagrant/kohaclone/patroncards/edit-layout.pl line 239
edit-layout.pl: Use of uninitialized value $field in concatenation (.) or string at /home/vagrant/kohaclone/patroncards/edit-layout.pl line 239
edit-layout.pl: Use of uninitialized value $field in concatenation (.) or string at /home/vagrant/kohaclone/patroncards/edit-layout.pl line 239
edit-layout.pl: Use of uninitialized value $image in numeric lt (<) at /home/vagrant/kohaclone/patroncards/edit-layout.pl line 247
edit-layout.pl: Use of uninitialized value $image in concatenation (.) or string at /home/vagrant/kohaclone/patroncards/edit-layout.pl line 247
edit-layout.pl: Use of uninitialized value $image in concatenation (.) or string at /home/vagrant/kohaclone/patroncards/edit-layout.pl line 247.

To reproduce, go to Tools -> Patron Card Creator -> New layout
Comment 1 Aleisha Amohia 2016-04-25 23:10:57 UTC Comment hidden (obsolete)
Comment 2 Mark Tompsett 2016-04-25 23:39:19 UTC
Comment on attachment 50686 [details] [review]
Bug 15414: Silencing warns triggered by creating a new layout in patron card creator

Review of attachment 50686 [details] [review]:
-----------------------------------------------------------------

::: patroncards/edit-layout.pl
@@ +236,4 @@
>  elsif  ($op eq 'new') { # this is a new layout
>      $layout = C4::Patroncards::Layout->new();
>      my @fields = ();
> +    for (my $field = 0; $field < 4; $field++) {     # limit 3 text fields

Nice catch on the initialization missing.
Comment 3 Mark Tompsett 2016-04-25 23:43:09 UTC Comment hidden (obsolete)
Comment 4 Kyle M Hall 2016-04-28 13:44:24 UTC
Created attachment 50923 [details] [review]
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>
Comment 5 Kyle M Hall 2016-04-29 11:36:27 UTC
Pushed to master! Should be in the May 2016 release. Grazie Aleisha!