Bug 16747 - Fix regression in patron card creator (patron image)
Summary: Fix regression in patron card creator (patron image)
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Label/patron card printing (show other bugs)
Version: Main
Hardware: All All
: P5 - low critical (vote)
Assignee: Marc Véron
QA Contact: Testopia
URL:
Keywords:
Depends on: 15635
Blocks:
  Show dependency treegraph
 
Reported: 2016-06-15 20:52 UTC by Marc Véron
Modified: 2019-06-27 09:24 UTC (History)
4 users (show)

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


Attachments
Bug 16747 - Patron card creator broken with version 16.05 (2.00 KB, patch)
2016-06-16 07:41 UTC, Marc Véron
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 16747 - Patron card creator broken with version 16.05 (2.16 KB, patch)
2016-06-17 13:26 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 16747 - Patron card creator broken with version 16.05 (2.16 KB, patch)
2016-06-17 14:19 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 Marc Véron 2016-06-15 20:52:21 UTC
Patron card creator does no longer work with patron card definitions that worked with version 3.22. It seems to be related with  - Move the patron images related code to Koha::Patron::Images
Symptom: 
create-pdf.pl: Illegal division by zero at /usr/share/kohaclone/patroncards/create-pdf.pl line 200
This is due to the fact that $image_data is not filled properly.
Comment 1 Marc Véron 2016-06-15 20:57:58 UTC
Bug seems to be related to Bug 15635 - Move the patron images related code to Koha::Patron::Images
Comment 2 Marc Véron 2016-06-16 07:27:05 UTC
Found, patch follows.
Comment 3 Marc Véron 2016-06-16 07:41:59 UTC Comment hidden (obsolete)
Comment 4 Owen Leonard 2016-06-17 13:26:33 UTC Comment hidden (obsolete)
Comment 5 Kyle M Hall 2016-06-17 14:19:08 UTC
Created attachment 52483 [details] [review]
Bug 16747 - Patron card creator broken with version 16.05

To reproduce:
- Prepare a patron car layout with Image 1 using Patron Image
- Create a patron card for a patron without patron image
Result: OK, PDF can be opened wit PDF viewer
- Try to create a patron card with a patron who has a patron image
Result: The PDF file is corrupt (contains text only with error message)
        intranet error log contains: create-pdf.pl: Illegal division
        by zero at /usr/share/kohaclone/patroncards/create-pdf.pl line 200
To test:
- Apply patch
- Create a patron card with a patron who has a patron image
Result: PDF is OK and contains the image

Bonus test: Do the same with a card layout with an additional image
(Image 2: Image source: Other image)

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Test and bonus test pass: PDF generated without errors.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 6 Brendan Gallagher 2016-06-21 20:52:13 UTC
Pushed to Master - Should be in the November 2016 Release.  Thanks!
Comment 7 Frédéric Demians 2016-06-24 05:49:11 UTC
Pushed in 16.05. Will be in 16.05.01.
Comment 8 Julian Maurice 2016-07-01 07:56:18 UTC
Not needed in 3.22.x