Bug 14138 - Patroncard: Warn user if PDF creation fails
Summary: Patroncard: Warn user if PDF creation fails
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Label/patron card printing (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor (vote)
Assignee: Marc Véron
QA Contact: Testopia
URL:
Keywords:
Depends on: 14122
Blocks:
  Show dependency treegraph
 
Reported: 2015-05-04 14:13 UTC by Marc Véron
Modified: 2018-01-25 10:58 UTC (History)
6 users (show)

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


Attachments
Bug 14138 - Patroncard: POC for pre-testing parameters for create-pdf.pl (5.96 KB, patch)
2015-05-05 14:45 UTC, Marc Véron
Details | Diff | Splinter Review
Bug 14138: Patroncard: Warn user if PDF creation fails (17.17 KB, patch)
2016-07-08 15:34 UTC, Marc Véron
Details | Diff | Splinter Review
Bug 14138: Patroncard: Warn user if PDF creation fails (19.42 KB, patch)
2016-07-09 11:04 UTC, Marc Véron
Details | Diff | Splinter Review
Bug 14138: Patroncard: Warn user if PDF creation fails (6.03 KB, patch)
2016-07-09 13:54 UTC, Marc Véron
Details | Diff | Splinter Review
Bug 14138: Patroncard: Warn user if PDF creation fails (5.60 KB, patch)
2016-07-09 14:00 UTC, Marc Véron
Details | Diff | Splinter Review
Bug 14138: Patroncard: Warn user if PDF creation fails (6.76 KB, patch)
2016-07-09 15:11 UTC, Marc Véron
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 14138: Patroncard: Warn user if PDF creation fails (6.86 KB, patch)
2016-07-12 13:52 UTC, Owen Leonard
Details | Diff | Splinter Review
[PASSED QA] Bug 14138: Patroncard: Warn user if PDF creation fails (6.87 KB, patch)
2016-07-12 21:15 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-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.