Bug 15068 - Get rid of warnings in members/summary-print.pl
Summary: Get rid of warnings in members/summary-print.pl
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: master
Hardware: All All
: P5 - low trivial (vote)
Assignee: Marc Véron
QA Contact: Testopia
URL:
Whiteboard:
Keywords:
: 14483 (view as bug list)
Depends on:
Blocks:
 
Reported: 2015-10-27 11:11 UTC by Marc Véron
Modified: 2017-06-14 22:05 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:


Attachments
Bug 15068 - Get rid of warnings in members/summary-print.pl (3.13 KB, patch)
2015-10-27 11:43 UTC, Marc Véron
Details | Diff | Splinter Review
Bug 15068 - Get rid of warnings in members/summary-print.pl (3.30 KB, patch)
2015-11-03 10:55 UTC, Frédéric Demians
Details | Diff | Splinter Review
[PASSED QA] Bug 15068 - Get rid of warnings in members/summary-print.pl (3.37 KB, patch)
2015-11-04 00:17 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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 M. 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.