Bug 12315 - MTT FIX: Advanced notices are duplicated and not sent to the right patron
Summary: MTT FIX: Advanced notices are duplicated and not sent to the right patron
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Tools (show other bugs)
Version: master
Hardware: All All
: P5 - low critical (vote)
Assignee: Jonathan Druart
QA Contact: Galen Charlton
URL:
Keywords:
Depends on: 10833
Blocks:
  Show dependency treegraph
 
Reported: 2014-05-27 08:10 UTC by Jonathan Druart
Modified: 2019-06-27 09:24 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 12315: Advanced notices are duplicated and not sent to the right patron (1.36 KB, patch)
2014-05-27 08:16 UTC, Jonathan Druart
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 12315: Advanced notices are duplicated and not sent to the right patron (1.58 KB, patch)
2014-05-27 13:08 UTC, Bernardo Gonzalez Kriegel
Details | Diff | Splinter Review
Bug 12315: fix sending of duplicate advanced notices (and sending advanced notices to wrong patron) (1.66 KB, patch)
2014-05-27 18:05 UTC, Galen Charlton
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Druart 2014-05-27 08:10:08 UTC
Bug 10833 introduced a variable loop but does not reset it every iteration.
So the first patron receives correct letters, but the followings received all the previous ones AND his letters.
Very bad...
Comment 1 Jonathan Druart 2014-05-27 08:16:29 UTC Comment hidden (obsolete)
Comment 2 Bernardo Gonzalez Kriegel 2014-05-27 13:08:37 UTC Comment hidden (obsolete)
Comment 3 Galen Charlton 2014-05-27 18:05:59 UTC
Created attachment 28497 [details] [review]
Bug 12315: fix sending of duplicate advanced notices (and sending advanced notices to wrong patron)

Bug 10833 introduced a variable loop but does not reset it every
iteration.

So the first patron receives correct letters, but the following ones
received all the previous ones as well as their own notices

Test plan:
0/ Delete the content of the message_queue table.
1/ Define advanced notices sent 2 days in advance for 2 patrons.
2/ Check 1 item out for each one and specify a due date today + 2 days.
3/ Launch the advance_notices.pl script.
4/ Before this patch, you got 3 notices. Now, you get 2 notices, 1 for
   each patron.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Work well, no errors.

Tested following test plan, printing on screen or saving into db,
3 messages before, 2 after (advance_notices.pl -v -n -m 2 -c)

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Comment 4 Tomás Cohen Arazi 2014-05-30 18:57:20 UTC
Pushed to master.

Thanks Jonathan!
Comment 5 Galen Charlton 2014-05-30 19:46:27 UTC
Pushed to 3.16.x.
Comment 6 Olli-Antti Kivilahti 2014-06-10 07:07:24 UTC
Thanks for this great fix!
It saved us a lot of trouble,

too bad this didn't extend to the digest subsystem as well.
I provided a followup as a separate Bug 12396.

Take care!
Comment 7 Fridolin Somers 2014-12-29 17:51:18 UTC
Bug 10833 is only since 3.16 so this patch is not needed for 3.14 and below.
I set as fixed