Bug 12717 - Library no longer receiving Overdue email for patrons without email address
Summary: Library no longer receiving Overdue email for patrons without email address
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Notices (show other bugs)
Version: master
Hardware: All All
: P5 - low critical (vote)
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords: regression
Depends on: 10832
Blocks:
  Show dependency treegraph
 
Reported: 2014-08-04 15:31 UTC by Katrin Fischer
Modified: 2019-06-27 09:24 UTC (History)
10 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 12717: Library no longer receiving Overdue email for patrons without email address (2.69 KB, patch)
2014-08-20 11:30 UTC, Jonathan Druart
Details | Diff | Splinter Review
[SIGNED OFF] Bug 12717: Library no longer receiving Overdue email for patrons without email address (2.76 KB, patch)
2014-08-23 15:58 UTC, Nick Clemens
Details | Diff | Splinter Review
[PASSED QA] Bug 12717: Library no longer receiving Overdue email for patrons without email address (3.13 KB, patch)
2014-08-26 15:30 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 Katrin Fischer 2014-08-04 15:31:13 UTC
With bug 10832 the handling of overdue emails has changes. Now if a patron has no email address, there is a 'print' message generated.

Before MTT was pushed overdues for patrons without email addresses would automatically be sent to the library as an attachement to an email and could be printed from there.

I don't see how this can be done now, but I might be missing a configuration option. Right now it looks like a regression for libraries not using server generated files.
Comment 1 Katrin Fischer 2014-08-04 15:40:21 UTC
The described behaviour is still in the documentation of overdue_notices.pl:

http://git.koha-community.org/gitweb/?p=koha.git;a=blob;f=misc/cronjobs/overdue_notices.pl;h=943c4867c60041c33a6c7742fd8c0183ce9a3de7;hb=4e278782f156a9d7452e6e9ddcefee9542b964fc#l192

192 =head2 Outgoing emails
193
194 Typically, messages are prepared for each patron with overdue
195 items. Messages for whom there is no email address on file are
196 collected and sent as attachments in a single email to each library
197 administrator, or if that is not set, then to the email address in the
198 C<KohaAdminEmailAddress> system preference.
Comment 2 David Cook 2014-08-05 00:05:00 UTC
(In reply to Katrin Fischer from comment #0)
> With bug 10832 the handling of overdue emails has changes. Now if a patron
> has no email address, there is a 'print' message generated.
> 
> Before MTT was pushed overdues for patrons without email addresses would
> automatically be sent to the library as an attachement to an email and could
> be printed from there.
> 
> I don't see how this can be done now, but I might be missing a configuration
> option. Right now it looks like a regression for libraries not using server
> generated files.

I think there is also an issue with the former HOLD_PRINT notices as well. http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10845#c37
Comment 3 Nicole C. Engard 2014-08-07 21:59:16 UTC
Upgrading severity, this is a big issue for libraries in rural areas with many patrons who do not have email addresses.
Comment 4 Katrin Fischer 2014-08-16 11:29:17 UTC
Ok,to make things worse, I am having trouble generating the files.

I tried:
overdue_notices.pl -html ./
Generates an empty HTML flie

overdue_notices.pl -csv ./
Generates an CSV file with the header line, but no data

gather_print_notices.pl ./
Generates a file named holdnotices-2014-08-16.html with my overdue letter ?

This seems currently seriously broken.
Comment 5 Katrin Fischer 2014-08-16 11:39:26 UTC
overdue_notices.pl -text ./
Empty txt file.

BUT: -n will get -csv -html and -text working again. But it is NOT a solution, as it will not just grab the notices that are supposed to be printed, but will grab them all and no emails will be generated.

From the documentation: -n     
Do not send any email. Overdue notices that would have been sent to the patrons or to the admin are printed to standard out. CSV data (if the -csv flag is set) is written to standard out or to any csv filename given.
Comment 6 Katrin Fischer 2014-08-16 17:18:34 UTC
Still testing - one patron with email address and one without, both generating an overdue notice today. I think the options I tested before all work like they should, but they offer no solution to the problem.

So I tried to make sure the old behaviour was as described. I found it working before the MTT changes, with:

git checkout 9834401c59ed2ac41ca354732a528a117404fb76
./misc/cronjobs/overdue_notices.pl (no parameters)
Generates an email to the patron and one to the library with the text version as attachement.

One of the differences between then and now is, that we now have an entry 'print' in the message_queue for the patrons without email. So we need to make sure that we can send an email with the overdue notices attached and set those enries to 'sent'.
Comment 7 Jonathan Druart 2014-08-20 09:18:47 UTC
I will try to provide a fix soon.
Comment 8 Jonathan Druart 2014-08-20 11:30:13 UTC Comment hidden (obsolete)
Comment 9 Jonathan Druart 2014-08-20 11:50:24 UTC
(In reply to David Cook from comment #2)
> I think there is also an issue with the former HOLD_PRINT notices as well.
> http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=10845#c37

Could you please detail what could be wrong with HOLD?
Comment 10 Larry Baerveldt 2014-08-22 22:25:28 UTC
I realize a patch has already been written for this, but I'm wondering if this is the best way to go.

For example, since gather_print_notices now seems to include all print notices, holds plus overdues, etc. (see bug 12810), and since Jonathan is working on a patch to get gather_print_notices to email files, maybe that should become that standard way of getting print notices, of all types, to the library staff. 

So, update gather_print_notices so that it's no longer "holds"-specific (i.e. stop naming the output file 'holdnotices...'), or possibly even have it output to different files depending on the type of notice. Then with the patch for bug 11678 in place, those would be emailed to the library, without the need to have the overdues cronjob email them.

Something to consider.

- Larry
Comment 11 Katrin Fischer 2014-08-23 08:08:52 UTC
I think moving to a file based solution long term is good - but this was a feature libraries were relying to and I think we should bring it back AND work towards replacing it by gather_print_notices.pl long term. Right now the other script doesn't offer the same functionality and overdues.pl can already create different output formats.
Comment 12 Katrin Fischer 2014-08-23 08:13:22 UTC
How I wish you could correct your bugzilla entries at times... Trying again to make more sense:

I think moving to gather_print_notices.pl long term is good - but this is a feature libraries are relying on currently that got broken accidentally. I think we should bring it back for now AND work towards offering another option with gather_print_notices.pl. At the moment gather_print_notices.pl doesn't offer the same functionality and overdues.pl can already create different output formats. - I haven't tested the patch yet, but it looks rather small and I hope it will fix the problem.
Comment 13 Chris Cormack 2014-08-23 08:29:48 UTC
I agree with Katrin, lets get the accidentally removed functionality back, then work on extending the gather_print_notices to do the same. There are a lot of libraries using this, and if they upgraded from 3.14.x to 3.16.x would experience a regression that they may not even notice for a few days. Until they wondered, why arent we getting emails anymore .. and then its too late to send out the notices.
Comment 14 Nick Clemens 2014-08-23 15:58:05 UTC Comment hidden (obsolete)
Comment 15 Larry Baerveldt 2014-08-23 23:08:58 UTC
I'm fine with restoring the functionality of overdues that was lost. However, we still need to address Bug 12810. Once this bug has been fixed, then a library that's also using gather_print_notices for holds will be getting multiple print overdue messages, one from overdues via email and another in the gather_print_notices output file.

Regards,
Larry
Comment 16 Katrin Fischer 2014-08-24 20:21:46 UTC
Hi Larry, I agree. Having the overdues in the holdnotices file doesn't make sense and we need to make changes there as well.
Comment 17 Katrin Fischer 2014-08-26 15:30:45 UTC
Created attachment 31163 [details] [review]
[PASSED QA] Bug 12717: Library no longer receiving Overdue email for patrons without email address

Bug 10832 changes the fallback behavior if a patron does not have email
address: a print notice is generated into the message_queue table.
But this can cause issue for some libraries. The script should sent an
email and (generated csv, html, text file) with the list of all unsent
notices.

Test plan:
1/ Add overdue to a patron without email address (or smsalertnumber)
2/ Check email in the overdue rules configuration (or sms)
3/ Launch the overdue_notices.pl cronjob
4/ Verify the message_queue contain a print notice AND an email notice
for the library

Signed-off-by: Nick Clemens <nick@quecheelibrary.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This works as described and restores the old behaviour for now, with
the difference that you have a print notice generated and visible
in the patron account notices tab that will say 'pending'.

We will have to figure out how we can change the workflows nicely
to have only one script deal with print notice in the future.
Comment 18 Katrin Fischer 2014-08-26 15:38:01 UTC
What could be the next step?

Things I can think off:
- offer an option for the script not to send the email to the library, adjust
  the documentation in the script?
- work on 11603 in order to make it possible to email files with 
  gather_print_notices.pl?
- add gather_print_notices.pl to the default cronjob files?
- verify that gather_print_notices.pl can be set up to work similar/better than
  overduenotices now?
Comment 19 Tomás Cohen Arazi 2014-08-26 18:43:59 UTC
Patch pushed to master.

Thanks Jonathan!
Comment 20 Galen Charlton 2014-09-23 04:57:07 UTC
Pushed to 3.16.x for inclusion in 3.16.4.
Comment 21 Fridolin Somers 2015-01-23 12:41:46 UTC
Bug 10832 is not in 3.14.x so this one is not needed.
I set as resolved