The content is being copied from one patron to all notices - it is because we are nesting a hashref so end up with a pointer instead of a new copy
Created attachment 95982 [details] [review] Bug 24164: Unit test
Created attachment 95983 [details] [review] Bug 24164: Copy the letter for each email To test: 1 - Set or have two patrons with emails - note thier borrowernumber for the report 2 - Create a report - note the report id SELECT borrowernumber, surname, firstname WHERE borrowernumber IN (##,##); 3 - Create a notice in circulation with code TESTEMAIL 4 - The content should be "[% surname %]" 5 - perl misc/cronjobs/patron_emailer.pl --report ## --notice TESTEMAIL --module circulation --from anyone@anywhere.com --verbose 6 - Note that the emails both have the same surname 7 - Apply patch 8 - Repeat 5 9 - Emails now have correct content
Created attachment 96040 [details] [review] Bug 24164: Copy the letter for each email To test: 1 - Set or have two patrons with emails - note thier borrowernumber for the report 2 - Create a report - note the report id SELECT borrowernumber, surname, firstname WHERE borrowernumber IN (##,##); 3 - Create a notice in circulation with code TESTEMAIL 4 - The content should be "[% surname %]" 5 - perl misc/cronjobs/patron_emailer.pl --report ## --notice TESTEMAIL --module circulation --from anyone@anywhere.com --verbose 6 - Note that the emails both have the same surname 7 - Apply patch 8 - Repeat 5 9 - Emails now have correct content Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com>
Potential for the wrong data to be sent to borrowers, upping the severity/priority.
Created attachment 96211 [details] [review] Bug 24164: Copy the letter for each email To test: 1 - Set or have two patrons with emails - note thier borrowernumber for the report 2 - Create a report - note the report id SELECT borrowernumber, surname, firstname WHERE borrowernumber IN (##,##); 3 - Create a notice in circulation with code TESTEMAIL 4 - The content should be "[% surname %]" 5 - perl misc/cronjobs/patron_emailer.pl --report ## --notice TESTEMAIL --module circulation --from anyone@anywhere.com --verbose 6 - Note that the emails both have the same surname 7 - Apply patch 8 - Repeat 5 9 - Emails now have correct content Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com> Signed-off-by: Jessica Zairo <jzairo@bywatersolutions.com>
Anyone else who tests, make sure to also set the following: In step 2 (make sure you add email to the SELECT statement and add a FROM statement - Create a report - note the report id SELECT borrowernumber, surname, firstname, email FROM borrowers
Created attachment 96220 [details] [review] Bug 24164: Unit test Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Created attachment 96221 [details] [review] Bug 24164: Copy the letter for each email To test: 1 - Set or have two patrons with emails - note thier borrowernumber for the report 2 - Create a report - note the report id ($REPORT_ID) SELECT borrowernumber, surname, firstname, email FROM borrowers WHERE borrowernumber IN (##,##); 3 - Create a notice in circulation with code TESTEMAIL 4 - The content should be "[% surname %]" 5 - perl misc/cronjobs/patron_emailer.pl --report $REPORT_ID --notice TESTEMAIL --module circulation --from anyone@anywhere.com --verbose 6 - Note that the emails both have the same surname 7 - Apply patch 8 - Repeat 5 9 - Emails now have correct content Signed-off-by: Kelly McElligott <kelly@bywatersolutions.com> Signed-off-by: Jessica Zairo <jzairo@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Nice work everyone! Pushed to master for 20.05
Pushed to 19.11.01
backported to 19.05.x for 19.05.06