Bug 33888 - Overdues with fines report displays error 500
Summary: Overdues with fines report displays error 500
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low critical (vote)
Assignee: Jonathan Druart
QA Contact: Katrin Fischer
URL:
Keywords: rel_22_11_candidate
Depends on: 22375
Blocks:
  Show dependency treegraph
 
Reported: 2023-06-02 18:40 UTC by Hector Gonzalez
Modified: 2023-12-28 20:47 UTC (History)
8 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
This fixes the 'Circulation > Overdues > Overdues with fines' listing so that it lists overdue items where there are fines, instead of generating an error.
Version(s) released in:
23.11.00,23.05.01,22.11.08


Attachments
Bug 33888: (bug 22375 follow-up) Add missing USE KohaDates (1.23 KB, patch)
2023-06-07 08:35 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 33888: (bug 22375 follow-up) Add missing USE KohaDates (1.28 KB, patch)
2023-06-07 09:53 UTC, David Nind
Details | Diff | Splinter Review
Bug 33888: (bug 22375 follow-up) Add missing USE KohaDates (1.33 KB, patch)
2023-06-08 13:58 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 Hector Gonzalez 2023-06-02 18:40:57 UTC
If there are no overdue items with fines, the report works, but if there are overdues with fines, they won't display, the script returns a 500 error, and the log records this:

[Fri Jun 02 12:35:22.463020 2023] [cgi:error] [pid 8954] [client 192.168.1.1:47406] AH01215: Template process failed: undef error - : filter not found at /usr/share/koha/lib/C4/Templates.pm line 127.: /usr/share/koha/intranet/cgi-bin/circ/branchoverdues.pl, referer: http://bibliotecacho-intra.locales/cgi-bin/koha/circ/circulation-home.pl

[Fri Jun 02 12:35:22.527939 2023] [cgi:error] [pid 8954] [client 192.168.1.1:47406] End of script output before headers: branchoverdues.pl, referer: http://bibliotecacho-intra.locales/cgi-bin/koha/circ/circulation-home.pl

This happens for 23.05 too.  I tested this with a new install, english only, from debian packages.  Also happened when updating a couple of unrelated servers.
Comment 1 Jonathan Druart 2023-06-07 08:35:29 UTC
Created attachment 152077 [details] [review]
Bug 33888: (bug 22375 follow-up) Add missing USE KohaDates

Bug 22375 added use of KohaDates without the USE statement.

Test plan:
Make sure you have overdues and go to circ/branchoverdues.pl
Without this patch you get a 500
  Template process failed: undef error - : filter not found at /kohadevbox/koha/C4/Templates.pm line 127
With this patch applied you can see the overdue list
Comment 2 Jonathan Druart 2023-06-07 08:37:13 UTC
No other occurrences apparently, the following command return only include files 

  grep -l '$KohaDates' **/*.tt **/*.inc | xargs grep -L 'USE KohaDates' 

Ideally we should have the USE statement in include files as well, and add a test to catch those problems for KohaDates, raw, Price, etc.
Comment 3 David Nind 2023-06-07 09:53:32 UTC
Created attachment 152085 [details] [review]
Bug 33888: (bug 22375 follow-up) Add missing USE KohaDates

Bug 22375 added use of KohaDates without the USE statement.

Test plan:
Make sure you have overdues and go to circ/branchoverdues.pl
Without this patch you get a 500
  Template process failed: undef error - : filter not found at /kohadevbox/koha/C4/Templates.pm line 127
With this patch applied you can see the overdue list

Signed-off-by: David Nind <david@davidnind.com>
Comment 4 David Nind 2023-06-07 10:01:21 UTC
Testing notes (using KTD):

1. To generate overdues with fines:
   . set finesMode system preference to 'Calculate and charge'
   . configure the Circulation and fine rules so that fines will be charged, I set:
     . Fine amount: 5
     . Fine charging interval: 2
   . checkout some items to a patron - set the due date in the past
   . run the misc/cronjobs/fines.pl script to calculate fines (I used fines.pl -v -m 10)
Comment 5 Hector Gonzalez 2023-06-08 07:59:35 UTC
The patch fixes the problem in our servers, thank you!
Comment 6 Katrin Fischer 2023-06-08 13:58:21 UTC
Created attachment 152202 [details] [review]
Bug 33888: (bug 22375 follow-up) Add missing USE KohaDates

Bug 22375 added use of KohaDates without the USE statement.

Test plan:
Make sure you have overdues and go to circ/branchoverdues.pl
Without this patch you get a 500
  Template process failed: undef error - : filter not found at /kohadevbox/koha/C4/Templates.pm line 127
With this patch applied you can see the overdue list

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 7 Tomás Cohen Arazi 2023-06-09 11:28:04 UTC
Pushed to master for 23.11.

Nice work everyone, thanks!
Comment 8 Katrin Fischer 2023-06-16 14:07:52 UTC
Can this please be backported for next bugfix releas? No strings!
Comment 9 Laura Escamilla 2023-06-20 16:47:18 UTC
(In reply to Katrin Fischer from comment #8)
> Can this please be backported for next bugfix releas? No strings!


I second Katrin, can this please be backported to 22.11.xx?
Comment 10 Fridolin Somers 2023-06-26 12:44:48 UTC
Pushed to 23.05.x for 23.05.01
Comment 11 Fridolin Somers 2023-06-26 12:46:14 UTC
(In reply to Laura Escamilla from comment #9)
> (In reply to Katrin Fischer from comment #8)
> > Can this please be backported for next bugfix releas? No strings!
> 
> 
> I second Katrin, can this please be backported to 22.11.xx?

Indeed it is need for 22.11.x since it contains Bug 22375.
Now that I have backported to 23.05 it will come down to 22.11.x
Comment 12 David Cook 2023-07-05 06:51:20 UTC
(In reply to Fridolin Somers from comment #11)
> (In reply to Laura Escamilla from comment #9)
> > (In reply to Katrin Fischer from comment #8)
> > > Can this please be backported for next bugfix releas? No strings!
> > 
> > 
> > I second Katrin, can this please be backported to 22.11.xx?
> 
> Indeed it is need for 22.11.x since it contains Bug 22375.
> Now that I have backported to 23.05 it will come down to 22.11.x

Doesn't look like it was part of v22.11.07. Does that mean it'll be part of v22.11.08 at the end of July?
Comment 13 Martin Renvoize 2023-07-10 08:28:36 UTC
Yup, it'll make it to .08.. We'd already rolled .07 when this hit 23.05.01.
Comment 14 Pedro Amorim 2023-07-10 13:58:45 UTC
Nice work everyone!

Pushed to 22.11.x for next release