Bug 14138

Summary: Patroncard: Warn user if PDF creation fails
Product: Koha Reporter: Marc Véron <veron>
Component: Label/patron card printingAssignee: Marc Véron <veron>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: minor    
Priority: P5 - low CC: frederic, gwilliams, indradg, julian.maurice, kyle, victor
Version: master   
Hardware: All   
OS: All   
See Also: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14122
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14131
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on: 14122    
Bug Blocks:    
Attachments: Bug 14138 - Patroncard: POC for pre-testing parameters for create-pdf.pl
Bug 14138: Patroncard: Warn user if PDF creation fails
Bug 14138: Patroncard: Warn user if PDF creation fails
Bug 14138: Patroncard: Warn user if PDF creation fails
Bug 14138: Patroncard: Warn user if PDF creation fails
Bug 14138: Patroncard: Warn user if PDF creation fails
[SIGNED-OFF] Bug 14138: Patroncard: Warn user if PDF creation fails
[PASSED QA] Bug 14138: Patroncard: Warn user if PDF creation fails

Description Marc Véron 2015-05-04 14:13:33 UTC
Creating PDF for patron cards fails if it is getting invalid parameters for borrowernumber, template_id or layout_id
Comment 1 Marc Véron 2015-05-05 14:45:24 UTC Comment hidden (obsolete)
Comment 2 Marc Véron 2016-07-08 15:34:59 UTC Comment hidden (obsolete)
Comment 3 Marc Véron 2016-07-09 11:04:24 UTC Comment hidden (obsolete)
Comment 4 Marc Véron 2016-07-09 13:54:32 UTC Comment hidden (obsolete)
Comment 5 Marc Véron 2016-07-09 14:00:19 UTC Comment hidden (obsolete)
Comment 6 Marc Véron 2016-07-09 15:11:12 UTC Comment hidden (obsolete)
Comment 7 Owen Leonard 2016-07-12 13:52:49 UTC Comment hidden (obsolete)
Comment 8 Katrin Fischer 2016-07-12 21:15:04 UTC
Created attachment 53352 [details] [review]
[PASSED QA] Bug 14138: Patroncard: Warn user if PDF creation fails

Change patroncards/create-pdf.pl to redirect with an error message
instead of writing an invalid pdf that does not open in pdf viewer.

To test:
- Apply patch

- Test that pdf creator behaves as before (with valid batches and
  patron lists)

- While testing, copy pdf link address from window with title 'Click
  the following link(s) to download...'

- Open another staff client browser tab

- Paste link to browser address field, change batch id rsp. patron
  list id to an invalid value and submit

- The window should redirect to cgi-bin/koha/patroncards/create-pdf.pl
  and display an error message

- Bonus test 1: Create an empty patron list and test patron card
  creation. You should get an error message as appropriate.

- Bonus test 2: Use a link with params like the following:
  ...create-pdf.pl?borrower_number=61&template_id=2&layout_id=1&start_card=1
  Verify that you can create a pdf with a valid borrower_number and that
  you get the error message with an invalid borrower number

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

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 9 Kyle M Hall 2016-07-15 15:01:27 UTC
Pushed to master for 16.11, thanks Marc!
Comment 10 Frédéric Demians 2016-08-01 13:39:27 UTC
Pushed in 16.05. Will be in 16.05.02.
Comment 11 Julian Maurice 2016-08-17 10:43:58 UTC
Patch pushed to 3.22.x, will be in 3.22.10
Comment 12 Victor Grousset/tuxayo 2018-01-25 10:58:36 UTC
Oh, a follow up patch got forgotten ;)

http://git.koha-community.org/gitweb/?p=koha.git;a=blob;f=patroncards/create-pdf.pl;hb=7e1c6dddde372f622cc88f993f72b8f81d0b6252#l66

«#Note fo bug 14138: Indenting follows in separate patch to ease review»

I'm not sure it's worth doing anything about this. This is a notification just in case.