Bug 15068

Summary: Get rid of warnings in members/summary-print.pl
Product: Koha Reporter: Marc Véron <veron>
Component: Architecture, internals, and plumbingAssignee: Marc Véron <veron>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: trivial    
Priority: P5 - low CC: aleisha, f.demians, liz, mtompset, tomascohen
Version: master   
Hardware: All   
OS: All   
See Also: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14483
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Attachments: Bug 15068 - Get rid of warnings in members/summary-print.pl
Bug 15068 - Get rid of warnings in members/summary-print.pl
[PASSED QA] Bug 15068 - Get rid of warnings in members/summary-print.pl

Description Marc Véron 2015-10-27 11:11:44 UTC
Printing a summary from a member's detail page can result in a lot of warnings like:

- use of uninitialized value in sprintf at /usr/share/kohaclone/members/summary-print.pl line 47

- Use of uninitialized value $roadtype in concatenation (.) or string at /usr/share/kohaclone/members/summary-print.pl line 61

- Use of uninitialized value in addition (+) at /usr/share/kohaclone/members/summary-print.pl line 87

- Argument "2015-11-03 23:59:00" isn't numeric in numeric comparison (<=>) at /usr/share/kohaclone/members/summary-print.pl line 103
Comment 1 Marc Véron 2015-10-27 11:43:42 UTC Comment hidden (obsolete)
Comment 2 Marc Véron 2015-10-27 11:45:48 UTC
*** Bug 14483 has been marked as a duplicate of this bug. ***
Comment 3 Mark Tompsett 2015-10-28 16:29:32 UTC
(In reply to Marc Véron from comment #1)
> - Use of uninitialized value in addition (+)
>   at /usr/share/kohaclone/members/summary-print.pl line 87
> 
> - Argument "2015-11-03 23:59:00" isn't numeric in numeric comparison (<=>)
> at /usr/share/kohaclone/members/summary-print.pl line 103
> 
...
> - Go to a detail page with a member who has a lot of fines
...
And items checked out, potentially overdue.

Triggering 47 and 61 is easy with the sample data after creating some fines on a user. Having difficulty triggering 87, which I feel will also trigger 103, if I have something checked out, but working on multiple bugs at once is hard. :)
Comment 4 Marc Véron 2015-10-28 23:31:18 UTC
(In reply to M. Tompsett from comment #3)
> (In reply to Marc Véron from comment #1)
> > - Use of uninitialized value in addition (+)
> >   at /usr/share/kohaclone/members/summary-print.pl line 87
> > 
> > - Argument "2015-11-03 23:59:00" isn't numeric in numeric comparison (<=>)
> > at /usr/share/kohaclone/members/summary-print.pl line 103
> > 
> ...
> > - Go to a detail page with a member who has a lot of fines
> ...
> And items checked out, potentially overdue.
> 
> Triggering 47 and 61 is easy with the sample data after creating some fines
> on a user. Having difficulty triggering 87, which I feel will also trigger
> 103, if I have something checked out, but working on multiple bugs at once
> is hard. :)

- 87 is due to items with no replacementprice (NULL in db)
- 103 triggers with multiple checkouts with due dates
Comment 5 Frédéric Demians 2015-11-03 10:55:14 UTC Comment hidden (obsolete)
Comment 6 Katrin Fischer 2015-11-04 00:17:59 UTC
Created attachment 44350 [details] [review]
[PASSED QA] Bug 15068 - Get rid of warnings in members/summary-print.pl

This patch removes warnings when printing a summary from a member's
detail page, like:

- use of uninitialized value in sprintf
  at /usr/share/kohaclone/members/summary-print.pl line 47

- Use of uninitialized value $roadtype in concatenation (.) or string
  at /usr/share/kohaclone/members/summary-print.pl line 61

- Use of uninitialized value in addition (+)
  at /usr/share/kohaclone/members/summary-print.pl line 87

- Argument "2015-11-03 23:59:00" isn't numeric in numeric comparison
  (<=>) at /usr/share/kohaclone/members/summary-print.pl line 103

To test:
- Apply patch
- Go to a detail page with a member who has a lot of fines
- Print summary
- Verify that warnings like the ones above do no longer appear.

Signed-off-by: Frederic Demians <f.demians@tamil.fr>
  Have been able to see those warnings in Apache log file, and notice
  their disappearance after applying this patch.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 7 Tomás Cohen Arazi 2015-11-04 14:01:46 UTC
Patch pushed to master.

Thanks Marc!
Comment 8 Frédéric Demians 2015-11-29 20:05:48 UTC
This patch has been pushed to 3.20.x, will be in 3.20.6.
Comment 9 Liz Rea 2016-01-06 21:08:07 UTC
Pushed to 3.18.13, and released.