[Koha-bugs] [Bug 14138] Patroncard: Prevent errors if create-pdf.pl gets wrong parameters

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Tue May 5 16:45:24 CEST 2015


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14138

--- Comment #1 from Marc Véron <veron at veron.ch> ---
Created attachment 38854
  -->
http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=38854&action=edit
Bug 14138 - Patroncard: POC for pre-testing parameters for create-pdf.pl

If wrong parameters are given, create-pdf.pl displays a "Software error" or
creates an invalid PDF (it is a text file containing  "Software error....").

This patch is a proof of concept with the aim to prevent such a situation.

It implements pre-testing the parameters provided for create-pdf.pl.
If wrong parameters are given, a error message is displayed instead of creating
the PDF.
The user has then the possibility to go back to the page she came from. (Patron
card tool, maybe later patron's detail page? )

To test:

1)
Apply on top of Bug 14122 (otherwise it is not possible to test for borrower)

2)
Test with links similar to the following
...cgi-bin/koha/patroncards/create-pdf.pl?borrower_number=61&template_id=24&layout_id=21&start_card=1
or:
...cgi-bin/koha/patroncards/create-pdf.pl?batch_id=8&template_id=24&layout_id=21&start_card=1

3)
Change values for existing / not existing Ids. If a parameter is not valid, a
new HTML page is displayed with a JavaScript alert.
(This will need optimization. Ideas and/or patterns for doing this part are
highly welcome).

Comments are welcome - is this the way to go?

Marc

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list