Bug 13468

Summary: overdue notice lists all checked out books
Product: Koha Reporter: Yuval Hager <yhager>
Component: NoticesAssignee: Martin Renvoize (ashimema) <martin.renvoize>
Status: CLOSED FIXED QA Contact: Jonathan Druart <jonathan.druart>
Severity: major    
Priority: P5 - low CC: chris, jonathan.druart, martin.renvoize, mtj, tomascohen
Version: 3.18   
Hardware: PC   
OS: Linux   
GIT URL: Initiative type: ---
Sponsorship status: --- Crowdfunding goal: 0
Patch complexity: --- Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
Circulation function:
Bug Depends on: 12529    
Bug Blocks:    
Attachments: BUG 13468: Overdue notice lists all checked out books
BUG 13468: Overdue notice lists all checked out books
BUG 13468: Overdue notice lists all checked out books

Description Yuval Hager 2014-12-15 21:13:30 UTC
I noticed this after upgrading to 3.18.1 (from 3.16). If a patron has overdue
items, they receive the overdue notice, but the list of overdue items includes
all the books they have checked out, not only the overdue ones.

I also get this error on the cron run, not sure if it's related:
Use of uninitialized value $borrowernumber in string eq at
/usr/share/koha/bin/cronjobs/overdue_notices.pl line 544.

Installed on Debian from the koha repositories.
Comment 1 Katrin Fischer 2014-12-16 08:20:48 UTC
I Yuval,

can you tell us a bit about your setup? How is the overdues script run in your installation? The script has several options that can be used, so knowing what happens on your system might help to get this fixed.
Comment 2 Martin Renvoize (ashimema) 2014-12-16 16:18:18 UTC
We're seeing this too now...

/usr/share/koha/bin/cronjobs/overdue_notices.pl -t

A quick look t the code, -t is 'triggered', and the last bug to touch that was Bug 12529.
Comment 3 Martin Renvoize (ashimema) 2014-12-16 16:29:46 UTC
(In reply to Martin Renvoize from comment #2)
Our setting for 'OverduenoticeCalendar' was set to ignore if that helps
Comment 4 Chris Cormack 2014-12-16 16:57:36 UTC
(In reply to Martin Renvoize from comment #3)
> (In reply to Martin Renvoize from comment #2)
> Our setting for 'OverduenoticeCalendar' was set to ignore if that helps

Can you bisect it until you find the commit for sure. Otherwise it'll have to wait for a while until I have any time to look at it.
Comment 5 Martin Renvoize (ashimema) 2014-12-16 17:21:03 UTC Comment hidden (obsolete)
Comment 6 Martin Renvoize (ashimema) 2014-12-16 17:23:22 UTC
Sorry Chris, you beat me to this one.

I believe this patch does the business...

My fault for missing it during QA of your patch.. I'm pretty sure it's that Holidays patch that exposed the problem.
Comment 7 Yuval Hager 2014-12-16 17:45:46 UTC
(In reply to Katrin Fischer from comment #1)
> I Yuval,
> 
> can you tell us a bit about your setup? How is the overdues script run in
> your installation? The script has several options that can be used, so
> knowing what happens on your system might help to get this fixed.

This has probably been resolved, but I don't want to leave your question unanswered. I use the standard debian cron runs:

koha-foreach --enabled --email /usr/share/koha/bin/cronjobs/overdue_notices.pl -t

Thanks for the quick resolution!
Comment 8 Chris Cormack 2014-12-16 19:59:58 UTC Comment hidden (obsolete)
Comment 9 Jonathan Druart 2014-12-17 10:08:53 UTC
Created attachment 34479 [details] [review]
BUG 13468: Overdue notice lists all checked out books

This patch should fix the issue when running under 'triggered' mode

To test:

1) Run overdue_notices.pl -t -n [to output notices to command
line]
2) Note that the notices output, list ALL checked out items
3) Apply Patch
4) Run again
5) Note the difference

Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Amended patch: remove space changes.
Comment 10 Tomás Cohen Arazi (tcohen) 2014-12-17 22:34:24 UTC
Patch pushed to master.

Thanks Martin!
Comment 11 Chris Cormack 2014-12-18 00:45:11 UTC
No string changes, pushed to 3.18.x will be in 3.18.2
Comment 12 Mason James 2014-12-22 19:25:55 UTC
(In reply to Chris Cormack from comment #11)
> No string changes, pushed to 3.18.x will be in 3.18.2

skipping patch for 3.16.x