Bug 20903 - Print payment receipt on child patron could end with server error
Summary: Print payment receipt on child patron could end with server error
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Patrons (show other bugs)
Version: master
Hardware: All All
: P5 - low major (vote)
Assignee: Josef Moravec
QA Contact: Testopia
URL:
Whiteboard:
Keywords:
Depends on: 19921
Blocks:
  Show dependency treegraph
 
Reported: 2018-06-08 09:41 UTC by Josef Moravec
Modified: 2018-09-24 13:21 UTC (History)
6 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 20903: Remove unnecessary category code parameters (1.26 KB, patch)
2018-06-08 09:52 UTC, Josef Moravec
Details | Diff | Splinter Review
Bug 20903: Remove unnecessary category code parameters (1.31 KB, patch)
2018-06-25 21:40 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 20903: Remove unnecessary category code parameters (1.39 KB, patch)
2018-06-26 15:22 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Josef Moravec 2018-06-08 09:41:21 UTC
When you wan't to print a payment receipt for child patron and have only one adult patron category defined, it ends up with internal server error.
Comment 1 Josef Moravec 2018-06-08 09:52:33 UTC
Created attachment 75915 [details] [review]
Bug 20903: Remove unnecessary category code parameters

Test plan:
0) Do no apply the patch
1) Have only one adults patrons category defined
2) Add a fine to child patron and pay it
3) Try to print the payment receipt (file printfeercpt.pl)
4) You see only ISE
5) Apply the patch
6) Try the printing again
7) Now you should see right receipt
Comment 2 Josef Moravec 2018-06-11 06:27:44 UTC
Comment on attachment 75915 [details] [review]
Bug 20903: Remove unnecessary category code parameters

Review of attachment 75915 [details] [review]:
-----------------------------------------------------------------

::: members/printfeercpt.pl
@@ -60,5 @@
>  
> -if ( $patron->is_child ) {
> -    my $patron_categories = Koha::Patron::Categories->search_limited({ category_type => 'A' }, {order_by => ['categorycode']});
> -    $template->param( 'CATCODE_MULTI' => 1) if $patron_categories->count > 1;
> -    $template->param( 'catcode' => $patron_categories->next->categorycde )  if $patron_categories->count == 1;

This is the code which causes problem ('categorycde' instead of 'categorycode'). But as this code is not needed, I removed whole block of code.
Comment 3 Josef Moravec 2018-06-25 10:10:51 UTC
Raising severity as this generates ISE.
Comment 4 Katrin Fischer 2018-06-25 21:40:31 UTC
Created attachment 76424 [details] [review]
Bug 20903: Remove unnecessary category code parameters

Test plan:
0) Do no apply the patch
1) Have only one adults patrons category defined
2) Add a fine to child patron and pay it
3) Try to print the payment receipt (file printfeercpt.pl)
4) You see only ISE
5) Apply the patch
6) Try the printing again
7) Now you should see right receipt

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 5 Jonathan Druart 2018-06-26 15:22:26 UTC
Created attachment 76454 [details] [review]
Bug 20903: Remove unnecessary category code parameters

Test plan:
0) Do no apply the patch
1) Have only one adults patrons category defined
2) Add a fine to child patron and pay it
3) Try to print the payment receipt (file printfeercpt.pl)
4) You see only ISE
5) Apply the patch
6) Try the printing again
7) Now you should see right receipt

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 6 Jonathan Druart 2018-06-26 15:23:48 UTC
Caused by
  commit 585453fe20417779be84258b60d3d652d8e170e1
  Bug 19921: Fix update child when only one adult patron category exist
Comment 7 Nick Clemens 2018-06-29 21:01:29 UTC
Awesome work all!

Pushed to master for 18.11
Comment 8 Martin Renvoize 2018-07-02 07:21:09 UTC
Pushed to 18.05.x for 18.05.02
Comment 9 Fridolin SOMERS 2018-07-04 06:58:59 UTC
Pushed to 17.11.x for 17.11.08
Comment 10 Fridolin SOMERS 2018-09-24 13:21:22 UTC
Pushed to 17.05.x for 17.05.14